You need to sign in to do that
Don't have an account?
brielea1984
Avoid Re-Collapsing PageBlockSection when Validation Rule Error Occurs
On a Visualforce Page, I have a section which is collapsible by default and I use Javascript to toggle it
The issue I'm having is should the user try to save, and a validation rule is flagged, when the page rerenders the section is collapsed again. I want the section collapsed on the initial page load, but if the user toggles the section down, saves, and hits a validation rule, I'd like the section to remain "uncollapsed".
Any ideas? I have a controller I can add code too as well if needed.
Thanks!
<script type="text/javascript"> $(document).ready(function(){ collapseSections(); }); function collapseSections(){ $('img[id*="additionalProducts"]').each(function() { twistSection(this); }); } </script> <!--Some Code--> <apex:pageBlockSection title="Service Products" id="additionalProducts" showheader="true" collapsible="true" columns="1"> <!--Some Code-->
The issue I'm having is should the user try to save, and a validation rule is flagged, when the page rerenders the section is collapsed again. I want the section collapsed on the initial page load, but if the user toggles the section down, saves, and hits a validation rule, I'd like the section to remain "uncollapsed".
Any ideas? I have a controller I can add code too as well if needed.
Thanks!
that might steer you in the right direction
The issue is that when a pagemessage appears because a validation rule is violated, the page rerenders to display the error message - which causes the section to be collapsed again because I have it collapsed by default on page load.