function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NattyForceNattyForce 

null out unrendered fields

I'm using a VF page for a survey. The survey has a few instances of branch logic using the render attribute to show the pertinent questions. 

 

How can I 'reset' the value of the unrendered fields to NULL? For instance If I choose branch one, answer a few questions only to realize I need branch two, I don't want the values of questions in branch one to be saved. I hope I'm explaining this clearly. Any ideas or suggestions?

 

Thanks in advance

 

-Natty

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox

You may try using actionRegions, which submit only part of a page depending on the action chosen. If you're careful with this mechanism, you should be able to get the design to work. More likely, however, you'll just need to "know" which fields to clear out. Perhaps you might have a script object that defines the steps? Or a wrapper class for each step, the results of which are compiled in the final step to a complete record? This method would let you discard entire sets of questions just by deleting a wrapper object.

All Answers

sfdcfoxsfdcfox

You may try using actionRegions, which submit only part of a page depending on the action chosen. If you're careful with this mechanism, you should be able to get the design to work. More likely, however, you'll just need to "know" which fields to clear out. Perhaps you might have a script object that defines the steps? Or a wrapper class for each step, the results of which are compiled in the final step to a complete record? This method would let you discard entire sets of questions just by deleting a wrapper object.

This was selected as the best answer
NattyForceNattyForce

Thanks SFDC Fox. I will look into the the action region tag as I think the wrapper class may be out of my scope of ability and I'm under a tight timeline.