(→Common widget code) |
(→DATABASE) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 8: | Line 8: | ||
Widget is hidden. | Widget is hidden. | ||
− | + | Widget id, <code>${gbamID}</code>: | |
− | |||
− | Widget id: | ||
<pre> | <pre> | ||
auditAddress | auditAddress | ||
</pre> | </pre> | ||
+ | |||
+ | Back to [[ginstr_app_composer_reference#Widgets_table|GBAM widgets table]] | ||
+ | |||
+ | == Datatypes == | ||
+ | |||
+ | Value is stored from widget to database as [[:Category:Datatypes#text|<code>text</code>]] datatype. | ||
== Predefined user data == | == Predefined user data == | ||
==== PreLoaded ==== | ==== PreLoaded ==== | ||
− | + | * [[GBAMRulesForIDGeneration#.24.7BscreenLabel.7D|<code>${screenLabel}</code>]] | |
− | |||
− | * ${ | ||
==== Properties panel ==== | ==== Properties panel ==== | ||
User will configure this data in properties panels of selected widget: | User will configure this data in properties panels of selected widget: | ||
− | GENERAL | + | =====GENERAL===== |
− | * ${widgetLabel} | + | * "database column headline", [[GBAMRulesForIDGeneration#.24.7BwidgetLabel.7D|<code>${widgetLabel}</code>]] |
+ | |||
+ | =====VALIDATIONS===== | ||
+ | * "unique", check uniqueness when widget gets saved into db, having "is part of database" checked, add to configuration.xml: | ||
+ | <syntaxhighlight lang="xml"> | ||
+ | <columnText unique="true|false"></columnText> | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | =====ACTION===== | ||
+ | * - | ||
− | == | + | ======ACTION MESSAGES====== |
− | + | * - | |
− | + | =====DATABASE===== | |
− | | | + | * "additional ginstr web column settings": |
− | + | :* "align text", radio button options with values: "left", "middle", "right", add to configuration.xml: | |
− | + | <syntaxhighlight lang="xml"> | |
− | + | <columnText> | |
− | + | <horizontalAlignment>left|center|right</horizontalAlignment> | |
− | + | </columnText> | |
− | + | </syntaxhighlight> | |
− | + | :* "list of allowed values" array with list of allowed values, add to configuration.xml: | |
− | + | <syntaxhighlight lang="xml"> | |
+ | <columnText> | ||
+ | <valuesList> | ||
+ | <value>val1</value> | ||
+ | <value>val2</value> | ||
+ | </valuesList> | ||
+ | </columnText> | ||
+ | </syntaxhighlight> | ||
+ | :* "pattern", add to configuration.xml: | ||
+ | <syntaxhighlight lang="xml"> | ||
+ | <columnText> | ||
+ | <pattern errorMessage="invalidTextTableValue">[0-9A-Z]{3}</pattern> | ||
+ | </columnText> | ||
+ | </syntaxhighlight> | ||
+ | :* "related unique columns", add to configuration.xml: | ||
+ | <syntaxhighlight lang="xml"> | ||
+ | <columnText> | ||
+ | <uniqueInsideList> | ||
+ | <reference> | ||
+ | <table>refTableId1</table> | ||
+ | <column>refColumnField1</column> | ||
+ | </reference> | ||
+ | <reference> | ||
+ | <table>refTableId2</table> | ||
+ | <column>refColumnField2</column> | ||
+ | </reference> | ||
+ | </uniqueInsideList> | ||
+ | </columnText> | ||
+ | </syntaxhighlight> | ||
== Code snippets == | == Code snippets == | ||
+ | === GBAM Code Variables === | ||
+ | |||
+ | Variables which are used in code snippet below but not defined in user modifiable inputs. | ||
+ | |||
+ | * <code>[[GBAMRulesForIDGeneration#WIDGET_ID.27S_.24.7BwidgetID.7D|${widgetID}]]</code> | ||
+ | |||
=== Common widget code === | === Common widget code === | ||
− | < | + | <syntaxhighlight lang="xml"> |
− | |||
<com.ginstr.widgets.GnEditText | <com.ginstr.widgets.GnEditText | ||
− | android:id="@+id/${ | + | android:id="@+id/${widgetID}_input" |
android:layout_width="match_parent" | android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||
Line 55: | Line 99: | ||
gn:visible="false" | gn:visible="false" | ||
gn:showAddress="true" /> | gn:showAddress="true" /> | ||
− | </ | + | </syntaxhighlight> |
− |
Latest revision as of 08:05, 31 March 2020
Widget obtains gps coordinates from gps module. After location is retrieved nominatim server is contacted to fetch the address and address is stored into the widget. Widget is hidden.
Widget id, ${gbamID}
:
auditAddress
Back to GBAM widgets table
Datatypes
Value is stored from widget to database as text
datatype.
Predefined user data
PreLoaded
Properties panel
User will configure this data in properties panels of selected widget:
GENERAL
- "database column headline",
${widgetLabel}
VALIDATIONS
- "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
- "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>
- "pattern", add to configuration.xml:
<columnText> <pattern errorMessage="invalidTextTableValue">[0-9A-Z]{3}</pattern> </columnText>
- "related unique columns", add to configuration.xml:
<columnText> <uniqueInsideList> <reference> <table>refTableId1</table> <column>refColumnField1</column> </reference> <reference> <table>refTableId2</table> <column>refColumnField2</column> </reference> </uniqueInsideList> </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.GnEditText android:id="@+id/${widgetID}_input" android:layout_width="match_parent" android:layout_height="wrap_content" gn:s_sourceType="gps" gn:dataType="text" gn:visible="false" gn:showAddress="true" />