From wiki.ginstr.com
Jump to: navigation, search
m (formatting)
(Events)
 
(19 intermediate revisions by 3 users not shown)
Line 37: Line 37:
 
|-
 
|-
 
| title="Attribute" | <code>gn:triggerOnTypingEndEmptyItem</code>
 
| title="Attribute" | <code>gn:triggerOnTypingEndEmptyItem</code>
| title="Description" | Triggers <code>[[gn:act_setOnTypingEnd]]</code> event even <code>GnEditText</code> content is empty.
+
| title="Description" | Triggers <code>[[gn:act_setOnTypingEnd]]</code> event even <code>[[GnEditText]]</code> content is empty.
 
Can be
 
Can be
 
* <code>true</code>
 
* <code>true</code>
 
* <code>false</code>
 
* <code>false</code>
 +
|-
 +
| title="Attribute" | <code>gn:singleLine</code>
 +
| title="Description" | Forces widget to be used as single line widget
 +
Can be
 +
* <code>true</code>
 +
* <code>false</code>
 +
|-
 +
| title="Attribute" | <code>gn:allowNonSelectedItems</code>
 +
| title="Description" | If set to true it allows to retrieve items which are not selected but typed into the widget as <code>[[Datatypes#text|text]]</code> datatype. ginstr app developer can use [[gn:act_widgetContent]] action to check if widget is <code>empty</code>. If <code>empty</code> it means that widget has no selection and that only text is typed and he can then store this value to variable of type <code>[[Datatypes#text|text]]</code> and if action returns that widget is <code>notempty</code> this means that selection in widget was made and that value is pointer.
 +
Can be
 +
* <code>true</code>
 +
* <code>false</code>
 +
|-
 +
| title="Attribute" | <code>gn:autoCapitalize</code>
 +
| title="Description" | Changes the first letter of entered text to upper case
 +
Can be
 +
* <code>true</code>
 +
* <code>false</code>
 +
|-
 +
| title="Attribute" | <code>gn:dataType</code>
 +
| title="Description" | Defines [[Datatypes|datatype]] of widget
 +
|-
 +
| title="Attribute" | <code>gn:displayColumns</code>
 +
| title="Description" | Represents a list of columns which data will be displayed in dropdown data as one item
 +
Can be
 +
* <code>hardcoded</code> values separated by <code>,</code> character
 +
|-
 +
| title="Attribute" | <code>gn:displayColumnsSeparator</code>
 +
| title="Description" | Represents a separator for column values
 +
Can be
 +
* <code>hardcoded</code>
 +
|-
 +
| title="Attribute" | <code>gn:s_sortOrder</code>
 +
| title="Description" | Toggles sort order between ascending & descending
 +
Can be
 +
* <code>regular</code> - sorts from A-Z
 +
* <code>reverse</code> - sorts from Z-A
 +
* <code>unsorted</code> - sorting is disabled
 +
|-
 +
| title="Attribute" | <code>gn:s_customLayoutXml</code>
 +
| title="Description" | Points to an XML file in '''“control”''' folder of ginstr app
 +
Can be
 +
* hardcoded - i.e. <code>someXmlLayoutName.xml</code>
 +
|-
 +
| title="Attribute" | <code>gn:textColor</code>
 +
| title="Description" | Represents a text color
 +
Can be
 +
* hardcoded
 +
|-
 +
| title="Attribute" | <code>gn:s_hint</code>
 +
| title="Description" | Sets text hint into <code>[http://developer.android.com/reference/android/widget/AutoCompleteTextView.html AutoCompleteTextView]</code>
 +
Can be
 +
* <code>@string</code>
 
|}
 
|}
  
 
==Events==
 
==Events==
 +
: <code>[[gn:act_setClick]]</code>
 +
: <code>[[gn:act_setLongClick]]</code>
 
: <code>[[gn:act_setOnTypingStart]]</code>
 
: <code>[[gn:act_setOnTypingStart]]</code>
 
: <code>[[gn:act_setOnTypingEnd]]</code>
 
: <code>[[gn:act_setOnTypingEnd]]</code>
 
: <code>[[gn:event_onSelectedItem]]</code>
 
: <code>[[gn:event_onSelectedItem]]</code>
 
: <code>[[gn:event_onClearedItem]]</code>
 
: <code>[[gn:event_onClearedItem]]</code>
 +
 +
==Data types==
 +
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 +
|-
 +
! scope="col" | Input
 +
|-
 +
| title="Value" | <code>[[Datatypes#rows|rows]]</code>
 +
|-
 +
| title="Value" | <code>[[Datatypes#rowsColumn|rowsColumn]]</code>
 +
|-
 +
| title="Value" | <code>[[Datatypes#iBeacon|iBeacon]]</code>
 +
|}
 +
 +
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 +
|-
 +
! scope="col" | Output
 +
|-
 +
| title="Value" | <code>[[Datatypes#text|text]]</code>
 +
|-
 +
| title="Value" | <code>[[Datatypes#number|number]]</code>
 +
|-
 +
| title="Value" | <code>[[Datatypes#iBeacon|iBeacon]]</code>
 +
|-
 +
| title="Value" | <code>[[Datatypes#enum|enum]]</code>
 +
|-
 +
| title="Value" | <code>[[Datatypes#pointer|pointer]]</code>
 +
|-
 +
| title="Value" | <code>[[Datatypes#status|status]]</code>
 +
|}
  
 
==Example==
 
==Example==
Line 63: Line 147:
 
   gn:typingTimeInterval="1000"
 
   gn:typingTimeInterval="1000"
 
   gn:triggerOnTypingEndEmptyItem="true"
 
   gn:triggerOnTypingEndEmptyItem="true"
 +
  gn:s_sortOrder="unsorted"
 +
  gn:s_customLayoutXml="widget_en_autocompletetextview.xml"
 
   gn:act_setOnTypingStart="[gn:act_toast]|[START]"
 
   gn:act_setOnTypingStart="[gn:act_toast]|[START]"
 
   gn:act_setOnTypingEnd="[gn:act_toast]|[END]"
 
   gn:act_setOnTypingEnd="[gn:act_toast]|[END]"

Latest revision as of 10:59, 8 August 2019

GnAutoCompleteTextView

Widget XML tag
<com.ginstr.widgets.GnAutoCompleteTextView>
Description
GnAutoCompleteTextView inherits regular Android AutoCompleteTextView widget.
It consists of an EditText used to search entries of dropdown values and a DropDown list which displays a list of entries which match search string.
It has two ways of functioning. It can receive values either from local resources or from the database.
See gn:act_fill_dropdown for retrieving values from local source.

XML Attributes Description

Attribute Description
gn:s_sourceType Sets source for data load into dropdown

Can be

  • local - Sets the source as array from resources (@array/resourceId)
  • database - Sets the source as database
gn:s_decimalFormat Formats dropdown data to specified number format
gn:completionThreshold Defines the number of characters that the user must type before completion suggestions are displayed in a drop down menu.
gn:typingTimeInterval Represents number of miliseconds after gn:act_setOnTypingEnd will be executed

Can be

  • hardcoded
gn:triggerOnTypingEndEmptyItem Triggers gn:act_setOnTypingEnd event even GnEditText content is empty.

Can be

  • true
  • false
gn:singleLine Forces widget to be used as single line widget

Can be

  • true
  • false
gn:allowNonSelectedItems If set to true it allows to retrieve items which are not selected but typed into the widget as text datatype. ginstr app developer can use gn:act_widgetContent action to check if widget is empty. If empty it means that widget has no selection and that only text is typed and he can then store this value to variable of type text and if action returns that widget is notempty this means that selection in widget was made and that value is pointer.

Can be

  • true
  • false
gn:autoCapitalize Changes the first letter of entered text to upper case

Can be

  • true
  • false
gn:dataType Defines datatype of widget
gn:displayColumns Represents a list of columns which data will be displayed in dropdown data as one item

Can be

  • hardcoded values separated by , character
gn:displayColumnsSeparator Represents a separator for column values

Can be

  • hardcoded
gn:s_sortOrder Toggles sort order between ascending & descending

Can be

  • regular - sorts from A-Z
  • reverse - sorts from Z-A
  • unsorted - sorting is disabled
gn:s_customLayoutXml Points to an XML file in “control” folder of ginstr app

Can be

  • hardcoded - i.e. someXmlLayoutName.xml
gn:textColor Represents a text color

Can be

  • hardcoded
gn:s_hint Sets text hint into AutoCompleteTextView

Can be

  • @string

Events

gn:act_setClick
gn:act_setLongClick
gn:act_setOnTypingStart
gn:act_setOnTypingEnd
gn:event_onSelectedItem
gn:event_onClearedItem

Data types

Input
rows
rowsColumn
iBeacon
Output
text
number
iBeacon
enum
pointer
status

Example

<com.ginstr.widgets.GnAutoCompleteTextView
  android:id="@+id/autoCompleteTextView1"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:layout_marginLeft="-5dp"
  android:background="#00000000"
  gn:s_sourceType="local"
  gn:data_source_key_local="@array/localAutoComplete"
  gn:completionThreshold="1"
  gn:act_validate="[name:RequiredValidator],[message=@string/screen2_dnrRequiredValidatorMessage]"
  gn:typingTimeInterval="1000"
  gn:triggerOnTypingEndEmptyItem="true"
  gn:s_sortOrder="unsorted"
  gn:s_customLayoutXml="widget_en_autocompletetextview.xml"
  gn:act_setOnTypingStart="[gn:act_toast]|[START]"
  gn:act_setOnTypingEnd="[gn:act_toast]|[END]"
  gn:event_onSelectedItem="[gn:act_toast]|[SELECT]"
  gn:event_onClearedItem="[gn:act_toast]|[CLEAR]"/>