From wiki.ginstr.com
Jump to: navigation, search
m (Mark moved page Gn:act showDialog to gn:act showDialog)
Line 3: Line 3:
 
[[Category:Action_Library]]
 
[[Category:Action_Library]]
  
<code>[[gn:act_showDialog]]</code> is used to display a popup dialog.
+
;Description: Action used to display a popup dialog.
  
;Can be used on widgets: any widget
+
;Action returns: void
 +
==Action signatures==
  
;Event trigger for action: no event, must be used in action set or conditional action.
+
===Display a dialog===
  
;Can be used as: a [[:Category:Actions#Action_types|no event action]]
+
;<code>[gn:act_showDialog]|[controlLayout;resultPair{m}{n}]</code>
  
;Additional required attributes on bound widget: none
+
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 +
|-
 +
! scope="col" | Parameter
 +
! scope="col" | Description
 +
|-
 +
| controlLayout
 +
| xml file from controls dir which is used as dialog layout
 +
|-
 +
| resultPair{m}{n}
 +
| resultPair represents a list of dialog widgets and target widgets pairs (separated by <code>;</code>), where each target will be filled with data from corresponding dialog widget when dialog's onBackPressed() event is fired.
 +
:<code>{m}</code> = list of <code>{n}</code> separated by <code>;</code>
 +
:<code>{n}</code> = <code>dialogWidget,targetWidget</code>
 +
* Valid dialog widgets:
 +
** [[GnTextView]]
 +
** [[GnEditText]]
  
;Additional required attributes on other widgets: none
+
* Valid [[target]] widgets:
==Action signature==
+
** [[GnTextView]]
;<code>[gn:act_showDialog]|[dialog.xml;@+id/dialogValue,@+id/targetWidget;@+id/dialogValue2,@+id/targetWidget2]]</code>
+
** [[GnEditText]]
==Value field content==
+
|-
;<code>dialog.xml</code>: defines custom layout to display on popup
+
|}
;<code>@+id/dialogValue</code>, <code>@+id/dialogValue2</code>: defines id's of widgets that are part of dialog
+
 
;<code>@+id/targetWidget</code>, <code>@+id/targetWidget2</code>: defines id's of widgets that are on screen where dialog was called from
+
====Example====
 +
<code>dialog_change_address.xml</code> - external layout file<br>
 +
<code>@+id/dialogValue,@+id/targetWidget</code> - {n}<br>
 +
<code>@+id/dialogValue,@+id/targetWidget;@+id/dialogValue2,@+id/targetWidget2</code> - resultPair{m}{n}<br><br>
 +
<code>[gn:act_showDialog]|[dialog_change_address.xml;@+id/dialogValue,@+id/targetWidget;@+id/dialogValue2,@+id/targetWidget2]</code>
 +
<hr>

Revision as of 15:45, 8 March 2017

gn:act_showDialog

Description
Action used to display a popup dialog.
Action returns
void

Action signatures

Display a dialog

[gn:act_showDialog]|[controlLayout;resultPair{m}{n}]
Parameter Description
controlLayout xml file from controls dir which is used as dialog layout
resultPair{m}{n} resultPair represents a list of dialog widgets and target widgets pairs (separated by ;), where each target will be filled with data from corresponding dialog widget when dialog's onBackPressed() event is fired.
{m} = list of {n} separated by ;
{n} = dialogWidget,targetWidget

Example

dialog_change_address.xml - external layout file
@+id/dialogValue,@+id/targetWidget - {n}
@+id/dialogValue,@+id/targetWidget;@+id/dialogValue2,@+id/targetWidget2 - resultPair{m}{n}

[gn:act_showDialog]|[dialog_change_address.xml;@+id/dialogValue,@+id/targetWidget;@+id/dialogValue2,@+id/targetWidget2]