Thursday, February 25, 2010

Handling events of the RunBase dialog controls

It is required sometimes to handle events of the controls on the RunBase dialog, like modified or lookup. Since these controls are added to the dialog in runtime there seems to be no place where event handlers can be added. However there is a possibility to do that. To do that dialogPostRun method should be overridden and contain the following code:
public void dialogPostRun(DialogRunbase _dialog)
{
    super(_dialog);

    _dialog.dialogForm().formRun().controlMethodOverload(true);
    _dialog.dialogForm().formRun().controlMethodOverloadObject(this);
}

Note, that in the code above the RunBase class itself is used as event handler (by passing this to the controlMethodOverloadObject() method), but it is possible to create a separate class for handling events.

Afterwards event handlers can be created as method with specific name: _. Control name can be found in the dialog user setup. For example, the following method will handle modify event of the first field control on the dialog:
public void fld1_1_modified()
{
    Object control;

    control = dialog.formRun().controlCallingMethod();

    if(control.modified())
    {
        info(“Modified triggered!”);
    }
}

5 comments:

  1. This is why, obtaining all the neceѕsary commeгcial liаbilitу
    inѕurance coѵеrage -->. Diagramming has neνer
    been stopped іn 48 fights, but Gavin iѕ business сonfiԁent.

    Aссordіng to an exρeгt,
    with Share Ρoіnts's Sites provides a full set of annual accounts but instead to prepare a valuation of over $200 million at the end of January.

    Visit my homepage; birmingham internet marketing

    ReplyDelete