From wiki.ginstr.com
Jump to: navigation, search

Device serial number (hidden)

Widget obtains serial number of device from Ginstr servers, which is unique in ginstr cloud and is based on IMEI. Once result is obtained it's stored into widget. Widget is hidden.

Widget id, ${gbamID}:

auditSerial

Back to GBAM widgets table

Datatypes

Value is stored from widget to database as number datatype.

Predefined user data

PreLoaded

Properties panel

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

GENERAL
VALIDATIONS
  • "unique", check uniqueness when widget gets saved into db, having "is part of database" checked, add to configuration.xml:
    <columnNumber unique="true|false"></columnNumber>
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":
  • "percentage %", add to configuration.xml:
<columnNumber>
    <percentage>true|false</percentage>
</columnNumber>
  • "horizontal alignment", add to configuration.xml:
<columnNumber>
    <horizontalAlignment>left|center|right</horizontalAlignment>
</columnNumber>
  • "list of allowed values", add to configuration.xml:
<columnNumber>
    <valuesList>
    <value>1</value>
    <value>2</value>
  </valuesList>
</columnNumber>
  • "related unique columns", add to configuration.xml:
<columnNumber>
    <uniqueInsideList>
        <reference>
          <table>refTableId1</table>
          <column>refColumnField1</column>
        </reference>
        <reference>
          <table>refTableId2</table>
          <column>refColumnField2</column>
        </reference>
    </uniqueInsideList>
</columnNumber>
  • "hidden ginstr web column settings":
  • "decimal places", 0 for integer, add to configuration.xml:
<columnNumber>
    <decimalPlaces>0</decimalPlaces>
</columnNumber>
  • "number signs", add to configuration.xml:
<numberSigns>
    <numberSign>equalToZero</numberSign>
    <numberSign>greaterThanZero</numberSign>
</numberSigns>

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="serial"
    gn:dataType="number"
    gn:visible="false"/>

configuration.xml

columnNumber has to have additional setting set:

<columnNumber>
    <natural>true</natural>
</columnNumber>