How do you pass JSON to a Pop-up Window

Hi Guys,

Just need your input and idea. I have a record that i need to pass to a pop-up but since pop-up window do not allow record to be pass as input parameter I am thinking of passing it as JSON.

How do you pass a JSON to a Pop-up window? I know that json serialize cannot be invoke without using an Action.

Any inputs appreciated.

Thank you very much.

Hi Michael, 

JSon can be passed to a popup as a text input, but if for some reason you are setting the json over the logic of your page dont forget to AjaxRefresh the popup link or button, or the new value wont be setted to the popup.

BR

Perhaps it might be a cleaner solution to create a temp Entity where you store your json and pass the id instead. (popups are basically iframes and you are loading a bunch of text into it, urls have a limited length and you might exceed it with json, causing the app to crash or fail).

So create an Entity, give it a text attribute for your JSON, pass the Id to your popup, in the popup preperation you fetch the JSON data using an Aggregate, then transform the JSON back into a record list.

Domingues wrote:

Hi Michael, 

JSon can be passed to a popup as a text input, but if for some reason you are setting the json over the logic of your page dont forget to AjaxRefresh the popup link or button, or the new value wont be setted to the popup.

BR

Hi Domingues,

Here is the scenario.

1. I have a tablerecord with an ADD and EDIT Button(Navigate to a Pop-up Webscreen) and a SAVE Button located in the Pop-up Webscreen.

2. When Clicking the Save button the record being added or edited does not automatically being committed in the Database. So what I did was Transform the record to JSON, pass it to the pop_up_editor_notify, desirialize it and append to the list.

3. Now I am having a hard time figuring out how to pass the JSON as text to the pop-up window. See below scenario


Michael Chu wrote:

Domingues wrote:

Hi Michael, 

JSon can be passed to a popup as a text input, but if for some reason you are setting the json over the logic of your page dont forget to AjaxRefresh the popup link or button, or the new value wont be setted to the popup.

BR

Hi Domingues,

Here is the scenario.

1. I have a tablerecord with an ADD and EDIT Button(Navigate to a Pop-up Webscreen) and a SAVE Button located in the Pop-up Webscreen.

2. When Clicking the Save button the record being added or edited does not automatically being committed in the Database. So what I did was Transform the record to JSON, pass it to the pop_up_editor_notify, desirialize it and append to the list.

3. Now I am having a hard time figuring out how to pass the JSON as text to the pop-up window. See below scenario


On this scneario you'll have to create a function that returns the json, and encapsulate that json serialize. 

Br


Thanks Guys, I think i figured it out.

1. Created a Method with input parameter as record and the output is JSON.

2. Set it to public and function.

3. Call that method in the navigate.


Michael Chu wrote:

Thanks Guys, I think i figured it out.

1. Created a Method with input parameter as record and the output is JSON.

2. Set it to public and function.

3. Call that method in the navigate.



Is it not possible to have this record as your input parameter instead?
And then call the function to generate a JSON from it inside the preparation of your FacilityPopup Screen?

Michael Chu wrote:

Thanks Guys, I think i figured it out.

1. Created a Method with input parameter as record and the output is JSON.

2. Set it to public and function.

3. Call that method in the navigate.


Yup that what i was trying to say :)

Br