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
sundar84sundar84 

how to get the Apex page Exception Messages before the Page refresh?

Hi Friends

 

I have Embedded the visual force page  in the standard. I have refreshed the standard page when click the save button in the visual force page  by using  this method

 

 

<apex:pageBlockButtons location="bottom" >
 <apex:commandButton value="Save" action="{!savePallet}" id="ipList" oncomplete="javascript&colon;window.top.location = '/{!ILI__c.id}'; return true;" reRender="{!isError}"/>
     <apex:commandButton value="cancel" action="{!cancelPallet}"/>
    </apex:pageBlockButtons>
I have set this isError flag intially false in the constructor and  put the flag value True in apex add Error messages locations.Some validation  have in controller. validation result Exception message havn't displayed in the visual force page when click the save button. I want to get the apex Exception messages before the page refresh..
Please let me know your suggestion...
Thanks
Sundar 

 

Ritesh AswaneyRitesh Aswaney

 <apex:commandButton value="Save" action="{!savePallet}" id="ipList" oncomplete="javascript&colon;window.top.location = '/{!ILI__c.id}'; return true;" reRender="{!isError}"/>


The reRender attribute is used to refresh a particular component, rather than having a boolean value. So reRender="idList" would re-render the visual element with the html id = idList

 

The rendered attribute can be assigned a boolean value - rendered = true or false is used to toggle rendering something on / off.

sundar84sundar84

 

I am using this java script property in the save button. oncomplete="javascript&colon;window.top.location = '/{!ILI__c.id}'; return true;"   I have some Data validation in my controller. If i enter the invalid data in the visuall force page and click the save button apex error message will be displayed in the visualforce page 
my problem is Validation messages didn't displayed when i enter the invalid information and click the save button.  the whole page has refreshed before display the validation error message. so Please how to display the Apex error messages. at the same time enter valid inforamtion and click the save button the whole page will need to refresh?
Thanks
Sundar