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

Text phone

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

Widget id, ${gbamID}

textPhone

Back to GBAM widgets table

Datatypes

Value is stored from widget to database as phoneNumber datatype.

Predefined user data

PreLoaded

Properties panel

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

GENERAL
VALIDATIONS
    <columnPhoneNumber required="true|false"></columnPhoneNumber>
  • "unique", check uniqueness when widget gets saved into db, having "is part of database" checked, add to configuration.xml:
    <columnPhoneNumber unique="true|false"></columnPhoneNumber>
internal validators

Validators not visible to user.

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":
  • "related unique columns", add to configuration.xml:
<columnPhoneNumber>
    <uniqueInsideList>
        <reference>
          <table>refTableId1</table>
          <column>refColumnField1</column>
        </reference>
        <reference>
          <table>refTableId2</table>
          <column>refColumnField2</column>
        </reference>
    </uniqueInsideList>
</columnPhoneNumber>

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/textPhone_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:inputType="TYPE_CLASS_PHONE"
    gn:dataType="phoneNumbers"
    gn:s_sourceType="input"
    gn:autoAdjustHeight="true"
    gn:style="@style/textPhone_input"/>

strings.xml

Lines to be added for each language.

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