About Flow Control (Obsolete)
Action parameters are passed directly in a string. When an action accepts more than one parameter, this can be provided in the same string separating each parameter by "->", or starting next parameter with "$".
This code reloads
users
field with a neworderBy
andquery
parameter. See Models.
@Model
@Populator(R.id.item_user)
List<User> users;
@Action("orderBy=age -> query = age > 20 $users")
GetModel btnAction;
You can execute java code in the action, this permits that you call any existing method or perform any action prior or after the action execution. If you want that the code be executed before the action, you should write: ";"+code+";". For the code to be executed after the action simply end the line with ";"
This code will run
doSomethingBefore()
method, then it'll start MainActivity and it will runfinish()
method. See Enhanced Activities
@Action(";doSomethingBefore(); -> finish();")
MainActivity btnAction;
void doSomethingBefore() {
}
To execute the action under certain condition, you should end the logical parameter with the symbol "?"
This code will start the activity only if startEnabled is true. See Enhanced Activities.
boolean startEnabled;
@Action("startEnabled? -> finish();")
MainActivity btnAction;
In the conditional can be any valid boolean expression.
Actions can be enumerated, to executed several actions on the same object. For it, it is enough to add a number at the end of the action.
@Action("Opening the Main Activity")
Toast btnAction1;
@Action("startEnabled? -> finish();")
MainActivity btnAction2;
See also
- [Action Types (Obsolete)](Action Types (Obsolete))
- [Available Actions (Obsolete)](Avaiblable Actions (Obsolete))
- [Action Sequences (Obsolete)](Action Sequences (Obsolete))
Sponsored by DSpot Sp. z o.o. Contact us at info@dspot.com.pl