cancel
Showing results for 
Search instead for 
Did you mean: 

How to Restore default values on click of reset button.

chinna_babu2
Active Participant
0 Kudos

Hi All,

I am working on SAP CRM 7.0 for Adobe interactive forms using web request.

With my form design and data mapping, on load of form I could see all the default values prepopulated.

here if the user changes some field values and want to reset to its original state I added a Reset button with script

{xfa.host.resetData();} instead of resetting to defaults it actually clearing all the form values. what am I doing wrong here ...?

Also every time user submites the form with data, system create a new version of the document with the updated values.

Lets suppose user has 4 versions, if he open 4th version, does some changes and clicks on the reset button it should rollback the data to 4th version, but as said its clearing the entire data.?

Does somebody had such issue and got a solution, if so please share it...

Thanks in Advance,

Chinna.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

i agree..

the reset button is working as per the functionality.if you want that on clicking the button it should restore to default values.

then you have to add a custom button. and on click event do coding.

in order to get the default values in those fields.

regards,

sakshi

Answers (3)

Answers (3)

chinna_babu2
Active Participant
0 Kudos

The only option left is is explicitly handling the values.

I will try to get it would post further info on this.

chinna_babu2
Active Participant
0 Kudos

Hi Chintan,

Thanks for your reply, fair enough we need to explictly handle such behaviour with scripting.

I have below thoughts please advice if you have any indea on the same.

I found couple of methods like exportdata, importdata, restorestate and restore, can these be used in such a way that on form initilaize I export data to a hidden field and on click of reset I flush everything and load data from this hidden field?

Edited by: Chinna Babu on Sep 2, 2010 5:10 AM

chintan_virani
Active Contributor
0 Kudos

I have not used restoreState methods however as I mentioned earlier you will need load the data into hidden fields and upon your custom "reset" button click, load the values from the hidden fields.

However if you have a big form with 50 fields, there will be too much scripting and may affect the performance.

chinna_babu2
Active Participant
0 Kudos

Hi Chintan,

Thanks for the reply.

Yes my form got more than 50 fields and performance is my concer, i will look into the restore options anyways.

Regards,

Chinna.

chintan_virani
Active Contributor
0 Kudos

Rest button is working as it should i.e. in any application if you have a reset button when user clicks on reset it means the user wants to refresh the complete data.

Now if you want to reset data to hold the previous values, you will have to play with hidden fields and presence properties for them i.e. store the drop-down value in a hidden text field and upon reset, set the drop-down to value from text field.