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!”);
    }
}

3 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
  2. I really love how it is simple on my eyes and the data are well written. I am wondering how I might be notified when a new post has been made. I’ve subscribed to your RSS which must do the trick! Have a great day! What are some of the cheapest places to travel to in the world? From Asia to Africa and Europe, Things to do 's got budget breakdowns for the cheapest places.

    ReplyDelete