From wiki.ginstr.com
Jump to: navigation, search
(Predefined user data)
(Predefined user data)
Line 29: Line 29:
 
<br>from <code>textEditable_label</code> to <code>textEditableMultiline_label</code>
 
<br>from <code>textEditable_label</code> to <code>textEditableMultiline_label</code>
 
<br>from <code>textEditable_input</code> to <code>textEditableMultiline_input</code>
 
<br>from <code>textEditable_input</code> to <code>textEditableMultiline_input</code>
<br>to configuration.xml column xml which is related to this widget is added following setting:
+
<br>add to configuration.xml:
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
 
<columnText>
 
<columnText>
Line 37: Line 37:
  
 
=====VALIDATIONS=====
 
=====VALIDATIONS=====
* "required", [[RequiredValidator]] to configuration.xml:
+
* "required", [[RequiredValidator]], add to configuration.xml:
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
 
     <columnText required="true|false"></columnText>
 
     <columnText required="true|false"></columnText>
 
</syntaxhighlight>
 
</syntaxhighlight>
 
* "min length", [[TextValidator#minLength]]
 
* "min length", [[TextValidator#minLength]]
* "max length", [[TextValidator#maxLength]], to configuration.xml:
+
* "max length", [[TextValidator#maxLength]], add to configuration.xml:
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
 
<columnText>
 
<columnText>
Line 48: Line 48:
 
</columnText>
 
</columnText>
 
</syntaxhighlight>
 
</syntaxhighlight>
* "unique", check uniqueness when widget gets saved into db, having "is part of database" checked, add to configuration.xml column:  
+
* "unique", check uniqueness when widget gets saved into db, having "is part of database" checked, add to configuration.xml:
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
 
     <columnText unique="true|false"></columnText>
 
     <columnText unique="true|false"></columnText>
Line 63: Line 63:
 
* "is part of database", checkbox option by default is set as checked. When checked database column is created for this widget.
 
* "is part of database", checkbox option by default is set as checked. When checked database column is created for this widget.
 
* "additional ginstr web column settings":
 
* "additional ginstr web column settings":
** "align text", radio button options with values: "left", "middle", "right" , to configuration.xml:
+
** "align text", radio button options with values: "left", "middle", "right", add to configuration.xml:
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
 
<columnText>
 
<columnText>
Line 69: Line 69:
 
</columnText>
 
</columnText>
 
</syntaxhighlight>
 
</syntaxhighlight>
** "list of allowed values" array with list of allowed values, to configuration.xml
+
** "list of allowed values" array with list of allowed values, add to configuration.xml:
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
 
<columnText>
 
<columnText>

Revision as of 08:49, 31 May 2017

Text editable

Widget is used for textual input of data by user. Value will be stored as datatype TEXT.

Widget id, ${gbamID}

textEditable

Back to GBAM widgets table

Predefined user data

PreLoaded

Properties panel

User will configure this data in properties panels of selected widget:

GENERAL

to widget @+id/${widgetID}_input and @+id/${widgetID}_label is replaced style:
from textEditable_label to textEditableMultiline_label
from textEditable_input to textEditableMultiline_input
add to configuration.xml:

<columnText>
    <multiline>true</multiline>
</columnText>
VALIDATIONS
    <columnText required="true|false"></columnText>
<columnText>
    <len>null|>=0|<=10000</len>
</columnText>
  • "unique", check uniqueness when widget gets saved into db, having "is part of database" checked, add to configuration.xml:
    <columnText unique="true|false"></columnText>


ACTION
  • -
ACTION MESSAGES
  • -
DATABASE
  • "is part of database", checkbox option by default is set as checked. When checked database column is created for this widget.
  • "additional ginstr web column settings":
    • "align text", radio button options with values: "left", "middle", "right", add to configuration.xml:
<columnText>
    <horizontalAlignment>left|center|right</horizontalAlignment>
</columnText>
    • "list of allowed values" array with list of allowed values, add to configuration.xml:
<columnText>
  <valuesList>
    <value>val1</value>
    <value>val2</value>
  </valuesList>
</columnText>

Code snippets

GBAM Code Variables

Variables which are used in code snippet below but not defined in user modifiable inputs.

Common widget code

<com.ginstr.widgets.GnTextView
    android:id="@+id/${widgetID}_label"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="@string/${widgetID}"
    gn:style="@style/textEditable_label"/>

<com.ginstr.widgets.GnEditText
    android:id="@+id/${widgetID}_input"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    gn:s_hint="@string/${widgetID}Hint"
    gn:dataType="text"
    gn:s_sourceType="input"
    gn:autoAdjustHeight="true"
    gn:style="@style/textEditable_input"/>

strings.xml

Lines to be added for each language.

<string name="${widgetID}">${widgetLabel}</string>
<string name="${widgetID}Hint">${widgetHint}</string>