78
Views
6
Comments
Data disappearing after moving to next web block 
Question

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

UserImage.jpg
vikas sharma
Champion

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.

2024-05-03 14-03-28
Sudip Dey

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

2024-05-03 14-03-28
Sudip Dey

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

UserImage.jpg
MIguel Carlo

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


project.oml
UserImage.jpg
Suriya Narayanan

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

UserImage.jpg
Poonam Verma

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.

 

Data.oap
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.