Page 1 of 1

[RPG]Invoking an ACTION when back to parent formview

Posted: Tue Mar 01, 2016 6:33 pm
by MegumiSawada
Hi,

I have a parent formview and a child formview which is called with PerformAction Presentmode(Stack) from the parent formview.
When the operation is back to parent formview from child formview(by using CloseForm), I would like to invoke specific ACTION on Parent FormView.
To be exact, I would like to refresh and set new values to the parent formview when return from child formview.
Is it possible to do so? If yes, could you please let me know how?

When the operation is moved to child formview, the parent program seems to stop at EXFMT statement.
So I wonder where I should write codes to invoke any ACTION.

I appreciate your kind advice.

Best Regards,
Megumi Sawada

Re: [RPG]Invoking an ACTION when back to parent formview

Posted: Wed Mar 02, 2016 7:11 am
by tsupartono
Megumi,
You can use the 'OnReturn' event handler in the PerformAction operation that opens the child form.
'OnReturn' event will be triggered (on the parent form) when the child form closes.

In the code example below, when the user closes the child form, the parent form will be sent an action "RETURNING".
Just like any event handler, you can attach any operation to the 'OnReturn' event, including ExecScript operation.

Code: Select all

     A                                  9  5HTML('
     A                                        Type: Button
     A                                        Text: "Open New (PerformAction)"
     A                                        OnClick.Operation
     A                                        (
     A                                         Type: PerformAction
     A                                         PresentMode: STACK
     A                                         Pgm: CHILDPGM
     A                                         OnReturn: RETURNING
     A                                        )
     A                                      ')
Then in the parent form, you can check if the RequestACTION is 'RETURNING'.

Re: [RPG]Invoking an ACTION when back to parent formview

Posted: Thu Mar 03, 2016 6:58 pm
by MegumiSawada
Hi Tony,

Thank you!