This topic is locked
[SOLVED]

Run a Tri-Part Event twice

10/29/2021 4:17:27 PM
PHPRunner General questions
U
uli author

Hi,

I have a custom button in each grid row.
In the client before part I have an input dialog
In the server part I do some manipulation
In the client after I show the result and ask for confirmation
If the result is not confirmed I want to take the input data to the client before input dialog for changes.

How to take the data from client after to client before and trigger the right button.?

Many thanks for help

admin 10/29/2021

It doesn't work this way and you cannot go through the whole ClientBefore - Server - ClientAfter routine one more time. You either need to perform all your calculations in ClientBefore event or you need to find a totally different way of handling this situation.

A
AlphaBase 10/30/2021

You can do this.

Create a 2nd button and make it hidden.
Have your first button ClientAfter call the second button code and do whatever.
To pass JS values form button 1 to button 2, use a window object, something like this:

window.SomeObjectName = {};
SomeObjectName.SomeName = someJSvariable;
SomeObjectName.SomeOtherName = someotherJSvariable;
etc

To click the 2nd button:

pageObj.getItemButton('Button_Name).click();

Your 2nd button ClientBefore can do something like:

var xYz = SomeObjectName.SomeName;
etc

--
I do this, otherwise I would have to use another platform.

U
uli author 10/31/2021

Thanks for your advice.

For me this works to call the grid button a second or more times from the Client After event

window.proxy = {};
window.proxy.someVariable = result;
pageObj.getItemButton('send_message_button',row.recordId()).click();