From wiki.ginstr.com
Jump to: navigation, search
(VALIDATIONS)
(ACTION)
Line 40: Line 40:
  
 
======ACTION MESSAGES======
 
======ACTION MESSAGES======
* "no data", if $defaultApp resource ${$dropDownNoData}, if we override then it has to be formed <code>{@string/${widgetID}NoData}</code> - message which appears when user clicks on dropdown and no data is loaded into dropdown
+
* "message in case of no data", is $defaultApp resource ${$dropDownNoData}, if we override then it has to be formed <code>{@string/${widgetID}NoData}</code> - message which appears when user clicks on dropdown and no data is loaded into dropdown
* "no selection text", if $defaultApp resource ${$dropDownZeroItem}, if we override then it has to be formed  <code>${@string/${widgetID}ZeroItem}</code> - text which appears when dropdown is initially loaded and nothing is selected in it
+
* "no selection text", is $defaultApp resource ${$dropDownZeroItem}, if we override then it has to be formed  <code>${@string/${widgetID}ZeroItem}</code> - text which appears when dropdown is initially loaded and nothing is selected in it
 
* "selected" if $defaultApp resource ${$selectedItem}, if we override then it has to be formed <code>{@string/${widgetID}Selected}</code> - text which appears in multiselect dropdown "display item"
 
* "selected" if $defaultApp resource ${$selectedItem}, if we override then it has to be formed <code>{@string/${widgetID}Selected}</code> - text which appears in multiselect dropdown "display item"
  

Revision as of 10:32, 4 April 2020

Dropdown local multiselect text

Widget is represented by a label and dropdown below label. Widget has option to select multiple items in dropdown. Data that is saved to database is of datatype "text". If multiple options are selected and saved, they are separated with ,

Widget id, ${gbamID}:

dropdownLocalMultiselectText

Back to GBAM widgets table

Datatypes

Value is stored from widget to database as text datatype.

Predefined user data

PreLoaded

Properties panel

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

GENERAL
VALIDATIONS
    <columnText required="true|false"></columnText>
ACTION
  • "dropdown items", ${dropdownItemsList} = ${<item>${dropdownListItem}</item>} - repeats to how many dropdown items were entered by user
  • ${dropdownListItem} - single "dropdown items" item entered by user
ACTION MESSAGES
  • "message in case of no data", is $defaultApp resource ${$dropDownNoData}, if we override then it has to be formed {@string/${widgetID}NoData} - message which appears when user clicks on dropdown and no data is loaded into dropdown
  • "no selection text", is $defaultApp resource ${$dropDownZeroItem}, if we override then it has to be formed ${@string/${widgetID}ZeroItem} - text which appears when dropdown is initially loaded and nothing is selected in it
  • "selected" if $defaultApp resource ${$selectedItem}, if we override then it has to be formed {@string/${widgetID}Selected} - text which appears in multiselect dropdown "display item"
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 text", radio button options with values: "left", "middle", "right", add to configuration.xml:
<columnText>
    <horizontalAlignment>left|center|right</horizontalAlignment>
</columnText>
  • "list of allowed values" array with list of allowed values, add to configuration.xml:
<columnText>
  <valuesList>
    <value>val1</value>
    <value>val2</value>
  </valuesList>
</columnText>
  • "pattern", add to configuration.xml:
<columnText>
    <pattern errorMessage="invalidTextTableValue">[0-9A-Z]{3}</pattern>
</columnText>
  • "related unique columns", add to configuration.xml:
<columnText>
    <uniqueInsideList>
        <reference>
          <table>refTableId1</table>
          <column>refColumnField1</column>
        </reference>
        <reference>
          <table>refTableId2</table>
          <column>refColumnField2</column>
        </reference>
    </uniqueInsideList>
</columnText>

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

<com.ginstr.widgets.GnDropDownSelection
	android:id="@+id/${widgetID}_input"
	android:layout_width="match_parent"
	android:layout_height="wrap_content"
	gn:s_sourceType="local"
        gn:data_source_key_local="@array/${widgetID}"
	gn:s_ZeroItemText="@string/${$dropDownZeroItem}"
	gn:s_SelectedItemText="@string/${$selectedItem}"
	gn:msg_nodata="@string/${$dropDownNoData}" 
	gn:act_afterLoad="[gn:act_fill_dropdown]|[@+id/${widgetID}_input]"
	gn:style="@style/dropdownDatabaseMultiselectText_input"/>

strings.xml

Lines to be added for each language.

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


arrays.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
	<string-array name="${widgetID}">
		${dropdownItemsList}
	</string-array>
</resources>