m (formatting) |
|||
Line 10: | Line 10: | ||
===Display a dialog=== | ===Display a dialog=== | ||
− | ;<code>[gn:act_showDialog]|[controlLayout;resultPair{m}{n}]</code> | + | :;<code>[gn:act_showDialog]|[controlLayout;resultPair{m}{n}]</code> |
− | {| class="wikitable sortable" style="font-size: 85%; text-align: left;" | + | :{| class="wikitable sortable" style="font-size: 85%; text-align: left;" |
|- | |- | ||
! scope="col" | Parameter | ! scope="col" | Parameter | ||
! scope="col" | Description | ! scope="col" | Description | ||
|- | |- | ||
− | | controlLayout | + | | <code>controlLayout</code> |
− | | | + | | XML file from controls directory which is used as dialog layout |
|- | |- | ||
− | | resultPair{m}{n} | + | | <code>resultPair{m}{n}</code> |
− | | | + | | 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 <code>onBackPressed()</code> event is fired. |
:<code>{m}</code> = list of <code>{n}</code> separated by <code>;</code> | :<code>{m}</code> = list of <code>{n}</code> separated by <code>;</code> | ||
:<code>{n}</code> = <code>dialogWidget,targetWidget</code> | :<code>{n}</code> = <code>dialogWidget,targetWidget</code> | ||
* Valid dialog widgets: | * Valid dialog widgets: | ||
− | ** [[GnTextView]] | + | ** <code>[[GnTextView]]</code> |
− | ** [[GnEditText]] | + | ** <code>[[GnEditText]]</code> |
* Valid [[target]] widgets: | * Valid [[target]] widgets: | ||
− | ** [[GnTextView]] | + | ** <code>[[GnTextView]]</code> |
− | ** [[GnEditText]] | + | ** <code>[[GnEditText]]</code> |
|- | |- | ||
|} | |} | ||
====Example==== | ====Example==== | ||
− | <code>dialog_change_address.xml</code> - external layout file<br> | + | :<code>dialog_change_address.xml</code> - external layout file<br> |
− | <code>@+id/dialogValue,@+id/targetWidget</code> - {n}<br> | + | :<code>@+id/dialogValue,@+id/targetWidget</code> - {n}<br> |
− | <code>@+id/dialogValue,@+id/targetWidget;@+id/dialogValue2,@+id/targetWidget2</code> - resultPair{m}{n} | + | :<code>@+id/dialogValue,@+id/targetWidget;@+id/dialogValue2,@+id/targetWidget2</code> - resultPair{m}{n}<br> |
− | <code>[gn:act_showDialog]|[dialog_change_address.xml;@+id/dialogValue,@+id/targetWidget;@+id/dialogValue2,@+id/targetWidget2]</code> | + | :; ⤷ <code>[gn:act_showDialog]|[dialog_change_address.xml;@+id/dialogValue,@+id/targetWidget;@+id/dialogValue2,@+id/targetWidget2]</code> |
<hr> | <hr> |
Revision as of 14:12, 12 July 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 directory which is used as dialog layout resultPair{m}{n}
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'sonBackPressed()
event is fired.{m}
= list of{n}
separated by;
{n}
=dialogWidget,targetWidget
- Valid dialog widgets:
- Valid target widgets:
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]
- ⤷