Data disappearing after moving to next web block

Hi,


I have a small project that is similar to a Questionaire/Survey page. 

The questionnaire has multiple sections such as identification, true or false and multiple choice type. these sections are separate web blocks. the parent sections web block fetches these sections via section ID in its preparation.

The main questionaire page loads the parent sections web block with the assigned sections under that questionaire.

My problem is that I have a back & next button. upon answering the 1st section (see image below) then I click next then I click back to 1st section, my answers in the page disappear because of the ajax refresh.

How will I be able to make the answers data stay when im doing the navigation. Thanks in advance


PS: the answers data is not saved yet to the database. 

1st section


2nd section

Hi,

I think you should use a local variable, which will hold the value for all fields of form. Use same variable to insert the values in database and to set the values in form also.

you have to use a variable of the entity type. and then needs to store assign the current value on it. so it will hold the value everywhere when you back or next in ajax refresh.

I hope this will help you,

Thank you,

Sudip

Is it possible to send the OML file so I can able to make the changes on it as per the requirements?


Thank you,

Sudip

Hi Mlguel carlo, 

You can use events in web block to get answers in the main page(questionaire page) and store in the page level local variable or in database, When ever you click the back or next button you can pass those answers to web block as input parameters. 

It will be more helpful if you share your OML file.


Regards

Suriya

Hi MIguel Carlo,

Your data is disappearing Because you are not storing it. I'm sharing an OML Hope this will helps you.

Try these steps

1. Store the data in an entity on click next and store the id in session variable or in client variable.

2.  Filter the aggregate with stored id.

 

Sudip Dey wrote:

Is it possible to send the OML file so I can able to make the changes on it as per the requirements?


Thank you,

Sudip

Its in the IOForm - CreateAnswerForm