Save data temporarily from an editable table in a webblock

Save data temporarily from an editable table in a webblock



I have a problem with saving data from an editable table temporarily, but first let me describe what I'm doing and how:

First of all I get all of my data via a REST API service. This returns a JSON string which in OutSystems is converted to a structure. In this structure is a "list-of-lists" element/attribute present. I created a webblock which contains an editable table. The content of this table is the inner list of the previously mentioned attribute. Then on a webpage I have a list of those webblocks which has the outer list as source. So on the page this "list-of-lists" element is visualized by mutiple (editable) tables under eachother.

Now here's the problem: a user can click on a button which adds a new editable table to the page (so in fact it adds an empty list to the list-of-lists element). However, when the user clicks on this button and he has made changes to a table, the data is lost when the user presses the button (the button has "Ajax submit" as method and the List Records widget is refreshed).

I have tried the "OnRowSave" option of the editable table, but it doesn't work. The web screen doesn't seem to receive the changes which are made by the user. I also tried the Notify option that if a user has made changes to a webblock's table, the parent (the web screen in this case) gets notified and tries to retrieve the edited list from it's child. 

Any ideas on how to solve this?

I don't understand the use case, but what I think you have to do is this..

before the onclick of the button, you will have to save the other webblocks.

this means, you create a hidden-button with a extended property like "hid=1" in the webblock.

this will generate multiple hidden buttons on the screen..

when you add a new table, the onclick will execute something like "$('input[hid=1]').click();"

this will click every button before it actually calls the screenaction.

this way you can save all webblocks..


Ok maybe this will help explain my problem a bit better.

I have the following screen: 

Then I add the following record to the table (marked in red):

Now if I click the button to create a new table on this page this happens:

As you can see, the record I added in the first table is now gone. My question is how do you prevent this from happening? Whenever I click the "add table" button, the data should still be there.