Adding or Modifying Actions

You can add or modify actions for controls or menus through the configureObjectHandlersById method.

Note: By default, the configureObjectHandlersById method adds all actions to controls and menus.

The following is a code example for adding actions:

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;

To modify actions, you can override this method by using custom code, and the widget event method navigationClick.