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

Counter

Widget is used to show a counter number. Value will be stored in couchdb as datatype Counter.

Widget id, ${gbamID}:

numberCounter

Back to GBAM widgets table

Datatypes

Value is stored from widget to database as counter datatype.

Predefined user data

PreLoaded

Properties panel

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

GENERAL
  • "label", ${widgetLabel}
  • "starting value", default value 1. Defines increment starting number ${startingValue}, column in configuration.xml should have setting:
<initial>${startingValue}</initial>
  • "step", default value 1. Defines the increase factor ${increment}, column in configuration.xml should have setting:
<delta>${increment}</delta>
VALIDATIONS
  • -
internal validators
  • -
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 counter", radio button options with values: "left", "middle", "right", add to configuration.xml:
<columnCounter>
    <horizontalAlignment>left|center|right</horizontalAlignment>
</columnCounter>
  • "initial", initial counter value, add to configuration.xml:
<columnCounter>
    <initial>1</initial>
</columnCounter>
  • "delta", the increment amount. Should be more than 0. Add to configuration.xml:
<columnCounter>
    <delta>1</delta>
</columnCounter>

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