Wednesday, June 8, 2011

Passing arguments between two forms

Query:
How can I pass information from 1 form to another?

Answer:
IN the clicked button of form A write following code,
void clicked()
{
    Args args;
    FormRun formRun;
    ;
    super();

    args = new Args(formstr(FormName));
    args.parm(parameters);
    formRun = classFactory.FormRunClass(args);
    formRun.init();
    formRun.run();
    formRun.wait();
    formRun.detach();
    parenttable_ds.refresh(); // Refreshing parent table DataSourceTable
    parenttable_ds.executeQuery(); // Refreshing Parent DataSourceTable Query
}

IN form B init method write following code
args = element.args();
args.parm()

2 comments:

  1. in Form B shouldnt you need to declare args?

    ReplyDelete
    Replies
    1. yes in Class Declaration

      Delete