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

Date read only

Date is loaded into widget by using other widgets and actions. Value will be stored as datatype DATE. Widget data can not be modified by user input.


Widget id, ${gbamID}:

dateReadOnly

Back to GBAM widgets table

Datatypes

Value is stored from widget to database as date 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:
    <columnDate unique="true|false"></columnDate>
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":
  • "required", add to configuration.xml:
    <columnDate required="true|false"></columnDate>
  • "minDate", add to configuration.xml:
<columnDate>
    <minDate>yyyy-mm-dd</minDate>
</columnDate>
  • "maxDate", add to configuration.xml:
<columnDate>
    <maxDate>yyyy-mm-dd</maxDate>
</columnDate>
  • "preset", add to configuration.xml:
<columnDate>
    <preset>yyyy-mm-dd</preset>
</columnDate>
  • "defaultFilter", add to configuration.xml:
<columnDate>
    <defaultFilter>today|yesterday|currentWeek|lastWeek|currentMonth|lastMonth|untilToday|fromToday|untilTomorrow|fromTomorrow|currentYear|lastYear</defaultFilter>
</columnDate>
  • "setCurrent", add to configuration.xml:
<columnDate>
    <setCurrent>true|false</setCurrent>
</columnDate>
  • "notEditable", add to configuration.xml:
<columnDate>
    <notEditable>true|false</notEditable>
</columnDate>
  • "related unique columns", add to configuration.xml:
<columnDate>
    <uniqueInsideList>
        <reference>
          <table>refTableId1</table>
          <column>refColumnField1</column>
        </reference>
        <reference>
          <table>refTableId2</table>
          <column>refColumnField2</column>
        </reference>
    </uniqueInsideList>
</columnDate>

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/dateReadOnly_label"/>

<com.ginstr.widgets.GnDatePicker
    android:id="@+id/${widgetID}_input"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    gn:dataType="date"
    gn:act_beforeLoad="[gn:act_disableWidget]|[@+id/${widgetID}_input]"
    gn:style="@style/dateReadOnly_input"/>

strings.xml

Lines to be added for each language.

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