Pass a list to different page.

Pass a list to different page.

  

Hello,

Outsystems 9.1 user here.

Is there a way to send Structure List to  different webscreen (In my case the different webscreen is a pop-up editor). My limitations are not to save the list in any temporary location.

I tried using ardoJSON to turn the list into JSON and passing it as Input parameter. 

It does work but on larger lists, It throws 404 error (Probably because GET header is not enough for the large list).

How should I tackle this issue?


Thanks in advance.


Hi Kataphroneo,

You can user session variable.



Gopal Jite wrote:

Hi Kataphroneo,

You can user session variable.



It says  I should avoid it.

Even If I use session would that be bad practice to write 100 rows x 5 attributes Structure to Session.

Are you using navigation or is this about passing a list into another webblock?

The first question is why you have that limitation? Maybe if you could explain the scenario we could help you a little bit more.

Extra explanation:

Passing information by input is limited by the URL size limitation.

Using on session, you are persisting that information in the DB anyway for the period of the session and increasing greatly its size, that's why Service Studio warns you for that bad practice. 

Solution

Yes you should avoid it, that's why it's a warning and NOT an error.


If your use-case is such that you only need to pass it to the calling screen and after that you clean the session-variable then it's not that big of an issue.

However, if you keep that session-variable permanent, well, then you have to think twice.


On that json, why can't you put the json in a newly created entity and pass it along that way?


Solution

Miguel Sousa wrote:

The first question is why you have that limitation? Maybe if you could explain the scenario we could help you a little bit more.

Extra explanation:

Passing information by input is limited by the URL size limitation.

Using on session, you are persisting that information in the DB anyway for the period of the session and increasing greatly its size, that's why Service Studio warns you for that bad practice. 

It's because I'm working on really messy and sensitive project (Adding in new function to flow expanding 25+ screens, So yeah). And because of reasons the uppers don't want me making any temporary entities or anything in that matter.

Can't Outsystems just post the JSON to Pop-up editor? Or maybe do some magic with javascript?


J. wrote:

Yes you should avoid it, that's why it's a warning and NOT an error.


If your use-case is such that you only need to pass it to the calling screen and after that you clean the session-variable then it's not that big of an issue.

However, if you keep that session-variable permanent, well, then you have to think twice.


On that json, why can't you put the json in a newly created entity and pass it along that way?


Yeah, My last resort will be a JSON saved in session for the brief transition.


Well, in that case maybe the session is the best option.

Create a link that goes to a screen action, assign the data to the List Session and use a runjavascript to click on the navigate link of the popup that you want to open.

In the preparation of that popup, create a local list variable and point that to the session, cleaning the session data with the ListClear.

Maybe you could explain to the business the impact of this implementation :)

Hope it helped.

I think you should really talk to your uppers and explain to them that there are limits to what is possible.
Sure it might work if you use a sesion variable, but that's not recommended, if you are using webblocks (having 1 web screen as a parent for all content, in a sense a one page application) and placing the contents you want to pass on to some invisible input field.
Then you could use javascript to get the contents of that field and use it in other webblocks.