Action Objects

Device Application Designer actions can be executed as a specific program or instruction, and are bound to controls such as Button, Hyperlink, Image, or List Item.

You can assign single or multiple actions to each of these controls. All Device Application Designer actions are implementations of the IBOBAction interface.

Device Application Designer Action Object Types
Action Type Class Description

Action

Action

Action is the base implementation of IBOBAction; its methods include hasFailed, isProcessing for monitoring the action status, and the run method to execute the action.

Action List

ActionList

Extends Action and holds a vector of actions. Its run method executes all the actions.

Alert Action

AlertAction

Shows an alert informational message dialog.

Alert Error Action

AlertErrorAction

Shows an alert error message dialog.

Alert Question Action

AlertQuestionAction

Shows an alert question message dialog.

Navigate Back Action

BackAction

BackAction pops current screen to display the parent screen.

Close Screen Action

CloseScreenAction

Closes the current screen.

Exit Action

ExitAction

Exits the current application.

Google Map Action

GoogleMapAction

Invokes Google Map and locates the address.

Lock Client Action

LockClientAction

Locks the current application.

Login Action

LoginAction

Logs in the user.

Logout Action

LogoutAction

Logs out the current user.

Object Query Action

NamedQueryAction

Executes the assigned object query.

Persist Action

PersistAction

Saves all the variables in a form.

Refresh Action

RefreshAction

Refreshes the current focused screen or supplied screen.

RIM PIM Application Action

RIMPimAppAction

Allows the read and write of data in personal information management (PIM) databases from a RIM client application, including e-mail, contacts, phone, or to-do lists.

Save Mobile Data Context Action

SaveMobileDataContextAction

Saves current mobile data control context to memory.

Screen Action

ScreenAction

Goes to another screen.

Submit Action

SubmitAction

Creates a update/insert/delete/others operation.

Synchronization Action

SyncAction

Performs synchronization actions on all MBOs within the synchronization group.

Synchronization Publication Action

SyncPublicationAction

Performs sync actions on specific publications (Publication > Synchronization group).

Tab Action

TabAction

Controls the tab layout manager to switch to different tabs.

Close Screen Action

CloseScreenAction

CloseScreenAction closes the current screen.

Example 1

This example illustrates adding and modifying an action:
protected void configureObjectHandlersById(int ID, Object object) {
switch (ID) {
......
case BUTTON8:
	Button localbutton8 = (Button) object;
	//Create list of actions 
	ActionList actionList3 = new ActionList();
	//Create set of submit elements 
	Vector submit2 = new Vector();
	//Create submit element "dept_id"
	submit2.addElement(new SubmitElement("dept_id", "2",
			VariableProperties.SUBMIT_CONTROL_TYPE, null, true, null,
			-1, "dept_id", MBOAttribute.SCHEMA_TYPE_INT, false, null,
			false));
	//Create submit element "dept_name"
	submit2.addElement(new SubmitElement("dept_name", "4",
			VariableProperties.SUBMIT_CONTROL_TYPE, null, false, null,
			40, "dept_name", MBOAttribute.SCHEMA_TYPE_STRING, false,
			null, false));
	//Create submit element "dept_head_id"
	submit2.addElement(new SubmitElement("dept_head_id", "6",
VariableProperties.SUBMIT_CONTROL_TYPE, null, false, null,
			-1, "dept_head_id", MBOAttribute.SCHEMA_TYPE_INT, false,
			null, false));
	localbutton8.setAction(actionList3);
	IBOBAction submitAction2 = new SubmitAction(
			BOBCUIDefinition.MBO_A_B_C_DEPARTMENT, this,
			OperationTypes.OPERATION_INSERT, submit2, false,
			"Input {0} is required.",
			"Input {0} exceeds the maximum length of {1}.", "create");
	actionList3.addAction(submitAction2);
	IBOBAction backAction1 = BackAction.getInstance();
	actionList3.addAction(backAction1);

			break;
This example illustrates a PIM action. The PIM action constructor takes an int type argument:
public interface RIMPimConstants
{
    // #################### Available RIM applications #################### //
    
public static int RIM_PIM_CONTACT   = 0;
public static int RIM_PIM_EMAIL     = 1;
public static int RIM_PIM_PHONE     = 2;
public static int RIM_PIM_EVENT     = 3;
public static int RIM_PIM_TODO      = 4;
public static int RIM_PIM_MEMO      = 5;
}
  • boolean isRead:
    • True indicates reading from the BlackBerry PIM application
    • False indicates writing to the BlackBerry PIM application
  • Object control – Can be the com.sybase.uep.bobclient.controls.MobileDataControl widgets such as the com.sybase.uep.bobclient.controls.MobileAppTable, com.sybase.uep.bobclient.controls.TwoColumnLayout or com.sybase.uep.bobclient.screens.IBOBScreen.
  • boolean launchPIMApp – true launches the PIM application after performing a write operation, otherwise false.
case MENU13:
			MenuAction menu13 = (MenuAction) object;
			Action rimAction9 = new RIMPimAppAction(
					RIMPimConstants.RIM_PIM_CONTACT, true, this, false);
			menu13.setAction(rimAction9);
			break;