+ Start a Discussion
Dippan PatelDippan Patel 

Custom validation error on visualforce page

Hi All, 

I have a custom validation error, it is getting displayed on visual force page but my save button keeps running. Below is the screenshot for that. User-added image

    <apex:pageMessages id ="showmsg"></apex:pageMessages>
    <apex:actionfunction name="lookupDetail" action="{!lookupDetail}" rerender="pnlScriptDupes" />

     <apex:actionfunction name="action_onSave" action="{!onSave1}" oncomplete="testfunc();" rerender="pnlScriptDupes" />
    <apex:actionfunction name="action_onCancel" action="{!Cancel}" />

    <apex:dynamiccomponent componentvalue="{!Ext.dynamicPageBlock}" rendered="
    <apex:outputpanel id="pnlScriptDupes">
      <div id="pnl-hdn-messages" style="display:none">
public PageReference onSave1(){
        Account a = (Account)con.getRecord();

            insert a;

            String id = ApexPages.CurrentPage().getParameters().get('id');
            PageReference ref = new PageReference('/'+a.id);
            return ref;
        catch(Exception ex){
            System.debug(LoggingLevel.ERROR, 'saveError:' + saveError);
            System.debug(LoggingLevel.ERROR, 'ERROR:  ' + ex);
            System.debug(LoggingLevel.ERROR, 'Inside Catch');

        return null;

Raj VakatiRaj Vakati
Looks like the issue in apex:dynamiccomponent  component .. can you share complete code