Possible bug with passing parameters from a childwebblock to parentwebblock

Hello,


I have tried several times to create the following scenario:

- A childwebblock has an input, that fires an event on change.

- A Parent webblock listens for this event and appends the input value passed along with the event to a local list variable.


If I repeat this scenario, my local list in the parentblock is always empty. In other words the list append works onlly during the execution of the function and after that my list is cleared.


I also tried it with the deprecated_notify and that works perfectly. Is this a bug or am I missing something?

Hi Jeroen,

I tried it out myself and I do not run into the same problem you have. Works like a charm for me.

Could you share an .oml, think I could quickly identify how to fix your issue.

Or you check out attached .oap, which works.

Regards,

Daniel

Unfortunately yours is only a webblock inside a screen. In my case its a child webblock in a parent webblock.


Oml attached.


Hi Jeroen,

You right... not exactly the same. I will have a look at your code.

Regards,

Daniel

Solution

Hi Jeroen,

I now can reproduce the situation that you desribe, i made the following changes which is fixing the problem that your list was not used and gets optimized by OS (not 100% this is correct root cause). To show the list entries i changed the data type from Text List to Text Record List.

Now i show it in a listrecord on the parent webblock and as you make changes to the cards in the child webblock the list on the parent webblock grows.

Attached the updated OML

Regards,

Daniel

Solution

Thanks for your response. It is fixing one part of the problem, however trying to use the Save functionality which tries to loop trough the list and logs it gives an error on my side.

Is there anyone else who might be experienced in this subject and has an insight into what's going on?

Hi Jeroen,

The input to your RunJavascript action is incorrect, on the oml version i attached in previous post, you have to change the script paramter of the RunJavascript action to:

"console.log('footest " + NameList.Current.Text + "')"

Regards,

Daniel

Hi Jeroen,

See attached version which uses a Text List instead of Text Record list

When I tried to solve your initial problem, i made it a Text record list to see if it made a difference.

But it didn't, in attached oml i reverted the Text Record List back to Text List.

Regards,

Daiel

Thank you, although it works now, this means that I always have to put a list records on the parent that uses the list? I have tried it without and then the list is empty again.

Hi Jeroen,

In attached oml, i removed the record list, but in the eventhandler in the parent block I do an Ajax Refresh. 

This seems to be enough to get your app working. 

On monday I will ask a collegue, for a better clarification of why this is neccesary.

Regards,

Daniel

Hi Daniel, any idea why this is necessary?

No not yet, talked to an OutSystems expert, and he also agreed it is kinda strange. Especially as it is not a problem between a webblock and a screen as parent.

I see if I can get someone else look at it, I would like to understand the reason too