Data binding issue for list of webblock containing form

Data binding issue for list of webblock containing form

  

Hello,

I am trying to display a list of form on my screen with help of a web block. Here are the steps i followed (Note: This is not the actual use case but just an example to elaborate my problem) :

  1. Created a new web block with one input parameter. Added a form widget within the block and an expression within the form just to display some value (could be the input parameter itself). 
  2. Created a new screen and added a List Record widget. 
  3. Assigned a random list to the List Record.
  4. Dragged the web block created on step 1 inside the List Record. 
  5. Assigned listrecord.current to web block's input parameter.
  6. A button added on screen with type= 'submit'. 

Issue: Whenever the application is loaded/refreshed, I could see the expected result with a list of forms containing respective expression value of each record. But whenever I click on the button (step 6), the content of the form is just lost. I even tried 'Ajax submit' for the button refreshing the List Records widget but it gives the same behavior.

I am attaching an OML as example.

Any help or round about is appreciated. The requirement is critical. Thanks.

Platform version: 10.0.613.0

Environment type: On premise

Solution

Hello Vinay,

One thing that does not happen on a submit, is the step when the Form is being rendered that he copies the data from the source to its record.

So, you are refreshing the screen, the list is being refreshed, all the lines will be rendered again, as well as the web blocks, but now, the Form, that is effectively being rendered again, will not copy the data and will be empty.

In this specifica case of yours, you will have to bind manually in the preparation of the web block.

Just add an assign and bind the record of the form to the input parameter.

I'm sending the OML with the change to you to see.

Cheers,
Eduardo Jauch

EDIT

Just remember that on submit, you have to find a way of persist your data. So, if you will not save it to database, it's best to save it to the local list so that when the page is rendered again, the FORM's will have the updated data.

Also, if you don't need to use Submit (sometimes you have to), you can use Ajax Submit / Ajax Refresh and have a finer control of what you need to change, by line, for example.

Solution

Hi Vinay,

Has alternative you can redirect to the current screen at the end of the button instead of using the end node. This will reload the page and will not persist the values on the form.

Ana Reis

Eduardo Jauch wrote:

Hello Vinay,

One thing that does not happen on a submit, is the step when the Form is being rendered that he copies the data from the source to its record.

So, you are refreshing the screen, the list is being refreshed, all the lines will be rendered again, as well as the web blocks, but now, the Form, that is effectively being rendered again, will not copy the data and will be empty.

In this specifica case of yours, you will have to bind manually in the preparation of the web block.

Just add an assign and bind the record of the form to the input parameter.

I'm sending the OML with the change to you to see.

Cheers,
Eduardo Jauch

EDIT

Just remember that on submit, you have to find a way of persist your data. So, if you will not save it to database, it's best to save it to the local list so that when the page is rendered again, the FORM's will have the updated data.

Also, if you don't need to use Submit (sometimes you have to), you can use Ajax Submit / Ajax Refresh and have a finer control of what you need to change, by line, for example.

Hey Eduardo,

This helped. Thanks.