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

Checkbox read only

Widget is represented by a text and checkbox right aligned. Data that is saved to database is of datatype "status". Widget data can not be modified by user input.

Widget id, ${gbamID}:

checkboxReadOnly

Back to GBAM widgets table

Datatypes

Value is stored from widget to database as status datatype.

Predefined user data

PreLoaded

Properties panel

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

GENERAL
VALIDATIONS
  • -
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":
  • "unique", check uniqueness when widget gets saved into db, having "is part of database" checked, add to configuration.xml:
    <columnStatus unique="true|false"></columnStatus>

Code snippets

GBAM Code Variables

Variables which are used in code snippet below but not defined in user modifiable inputs.

Common widget code

<RelativeLayout
	android:layout_width="match_parent"
	android:layout_height="wrap_content"
        gn:style="@style/checkboxReadOnly_container" >  

	<com.ginstr.widgets.GnTextView        
		android:id="@+id/${widgetID}_label"
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:layout_toLeftOf="@+id/${widgetID}_input" 
		android:text="@string/${widgetID}"
        gn:style="@style/checkboxReadOnly_text" />

	<com.ginstr.widgets.GnCheckBox  
		android:id="@+id/${widgetID}_input"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
        gn:dataType="status"
        gn:style="@style/checkboxReadOnly_checkbox" />
</RelativeLayout>  

strings.xml

Lines to be added for each language.

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