3 Replies Latest reply on Nov 15, 2010 1:41 AM by sivaprasad9394

    Error message in model panel not displaying event="onblur"??

    sivaprasad9394

      Hi all,

       

      I have a issue in model panel where error message is not displaying in screen when i do click and also onblur not working.

       

       

      My code in model panel,

       

       

      <a4j:region selfRendered="true">        

                    <h:inputText id="nameinputField" value="#{editCustomerInfoBean.name}" immediate="true"                    

                    required="true" requiredMessage="#{mag.requiredField}" size="28">

                    <a4j:support  event="onblur" ajaxSingle="true"

      limitToList="true" reRender="p_nameField,e_nameField,error_field"/>

         </h:inputText>

        <a4j:outputPanel id="p_nameField" ajaxRendered="true">

        <h:message id="e_nameField" for="nameinputField" styleClass="fieldError"/>  

        styleClass="fieldError"></rich:message>  

        </a4j:outputPanel>

      </a4j:region> 

       

       

       

       

      <a4j:commandButton reRender="p_nameField,e_nameField,namePanel"  limitToList="true"

           id="saveButtonId" styleClass="celcocm01" value="#{msg.save}"

           oncomplete="if(#{facesContext.maximumSeverity==null})#{rich:component('info_name_editmodal')}.hide();"/>

       

       

       

       

      How rerender the error message in modelpanel when user not entering any data in textbox and clicking submit means???Thanks for reading my comment.

       

      my Model panel page:

       


       

       

       

       

      <a4j:region selfRendered="true">        
                   <h:inputText id="nameinputField" value="#{editCustomerInfoBean.name}" immediate="true"                        
                              required="true" requiredMessage="#{mag.requiredField}" size="28">
                   <a4j:support  event="onblur" ajaxSingle="true" bypassUpdates="true"
      limitToList="true" reRender="p_nameField,e_nameField,error_field"/>
        </h:inputText>
      <a4j:outputPanel id="p_nameField" ajaxRendered="true">                        
                <h:message id="e_nameField"  for="nameinputField" styleClass="fieldError"/>
                <rich:message id="error_field" ajaxRendered="true" for="nameinputField"
                styleClass="fieldError"></rich:message>                        
      </a4j:outputPanel>
      </a4j:region> 
        • 1. Re: Error message in model panel not displaying event="onblur"??
          ilya_shaikovsky

          can't say much according to the snippet. but check the form presense in modal panel, and look for example of editing in modal with erros showing there

          • 2. Re: Error message in model panel not displaying event="onblur"??
            sivaprasad9394

            HI ilya ,

            Thank you for your reply.

             

            My jsp page:

             

            <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
            <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
            <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
            <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
            <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
            <rich:modalPanel id="info_name_editmodal" moveable="false" resizeable="false"
            width="950" height="450" showWhenRendered="false" style="overflow-y: scroll">
            <f:facet name="header">
            <h:outputText value="Edit Customer Info" styleClass="modalPanel12"/>
            </f:facet>
            <f:facet name="controls">
            <h:panelGroup>
            <h:outputLabel value="Press Esc to close"></h:outputLabel>
             
            <h:outputLabel value="(OR)"></h:outputLabel> 
            <h:graphicImage value="../_assets/image/close.png" id="hidelinkeditinfonric"
            styleClass="hidelink" style="border:0" alt="Close" title="Close"/>
            <rich:componentControl for="info_name_editmodal" attachTo="hidelinkeditinfonric"
            operation="hide" event="onclick"/> 
            </h:panelGroup>
            </f:facet>
            <a4j:form id="editnameForm">
            <rich:messages style="color:red;"></rich:messages>
            <rich:hotKey key="esc" selector="#editnameForm"   
                     handler="#{rich:element('editnameForm:cancelButtonId')}.click();event.stopPropagation();event.preventDefault(); return false;"
                      disableInInput="false"/>
            <table class="font_exist" width="950" height="50%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td>
                     <a4j:region selfRendered="true">
            <a4j:include id="commonPageView"  viewId="/existingcustomer/postpaid/header_common_modal.jsp"></a4j:include>
            </a4j:region>
                </td>
              </tr>
              <tr>
                <td>
                <table width="958" border="0">
                  <tr>
                    <td width="122"><h:outputText styleClass="ashcolor-bold-normaltext" value="#{msg['existingcustomer.postpaid.modelpanel.currname']}"/></td>
                    <td width="540"><h:outputText styleClass="ashcolor-bold-normaltext" id="editpostpaidNameFields" value="#{customerInfoBean.name}"/></td>
                    <td width="282"> </td>
                  </tr>
                          <tr>
                        <td width="122">          
                       <h:outputText  value="*" styleClass="mandatory_text" />
                       <h:outputText styleClass="ashcolor-bold-normaltext" value="#{msg['existingcustomer.postpaid.modelpanel.newname']}"/>                
                        </td>
                        <td width="540"> 
                        <a4j:region>                    
                            <h:panelGrid columns="9" border="0">
            <h:outputText  value="*" styleClass="mandatory_text" />
            <h:outputText value="#{msg.keyword}"/>
            <h:outputText value=":" />                   
                            <h:inputText id="keywordField" size="28" label="Name" immediate="true"
                            required="true" requiredMessage="#{msg.requiredField}">                
                                 <a4j:support  event="onblur"
                limitToList="true" reRender="p_keywordField,ekeywordField"/>                   
               </h:inputText>
               <a4j:outputPanel id="p_keywordField"  ajaxRendered="true">
            <h:message id="ekeywordField"  for="keywordField" styleClass="fieldError"/>
            </a4j:outputPanel> 
            </h:panelGrid>  
            </a4j:region>         
                          </td>
                    </tr>
                  <tr>
                    <td height="18"><h:outputText styleClass="ashcolor-bold-normaltext" id="notesField" value="#{msg.notes}"/>
                    <h:outputText styleClass="ashcolor-bold-normaltext" value="#{msg.semiColon}"/></td>
                    <td>       
                    <h:inputTextarea  id="nameNotesField" cols="50" rows="5" value="#{editCustomerInfoBean.nameNotes}"></h:inputTextarea>      
                    </td>
                    <td> </td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td> </td>
              </tr>
            </table>
            <rich:message showSummary="true" showDetail="false" for="keywordField" />
            <h:panelGrid columns="6">
            <a4j:commandButton reRender="panelName,p_nameField,e_nameField"  limitToList="true"
                id="saveButtonId" styleClass="celcocm01" value="#{msg.save}" type="submit"
                oncomplete="if(#{facesContext.maximumSeverity==null})#{rich:component('info_name_editmodal')}.hide();"/>
            <a4j:commandButton limitToList="true"  reRender="nameinputField,p_nameField,nameNotesField"
                type="submit" id="resetButtonId" styleClass="celcocm01" value="#{msg.reset}"
                oncomplete="if(#{facesContext.maximumSeverity==null})#{rich:component('info_name_editmodal')}.hide();"/>
            <a4j:commandButton limitToList="true" reRender="nameinputField,p_nameField,nameNotesField"
                type="submit" id="cancelButtonId" styleClass="celcocm01" value="#{msg.cancel}"
                oncomplete="if(#{facesContext.maximumSeverity==null})#{rich:component('info_name_editmodal')}.hide();"/>
            </h:panelGrid>
            </a4j:form>
            </rich:modalPanel>

            <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>

            <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

            <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>

            <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>

            <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

             

             

            <rich:modalPanel id="info_name_editmodal" moveable="false" resizeable="false"

            width="950" height="450" showWhenRendered="false" style="overflow-y: scroll">

             

            <f:facet name="header">

            <h:outputText value="Edit Customer Info" styleClass="modalPanel12"/>

            </f:facet>

            <f:facet name="controls">

            <h:panelGroup>

            <h:outputLabel value="Press Esc to close"></h:outputLabel>

             

             

            <h:outputLabel value="(OR)"></h:outputLabel> 

            <h:graphicImage value="../_assets/image/close.png" id="hidelinkeditinfonric"

            styleClass="hidelink" style="border:0" alt="Close" title="Close"/>

            <rich:componentControl for="info_name_editmodal" attachTo="hidelinkeditinfonric"

            operation="hide" event="onclick"/> 

            </h:panelGroup>

            </f:facet>

            <a4j:form id="editnameForm">

            <rich:messages style="color:red;"></rich:messages>

            <rich:hotKey key="esc" selector="#editnameForm"   

                     handler="#{rich:element('editnameForm:cancelButtonId')}.click();event.stopPropagation();event.preventDefault(); return false;"

                      disableInInput="false"/>

            <table class="font_exist" width="950" height="50%" border="0" cellpadding="0" cellspacing="0">

              <tr>

                <td>

                <a4j:region selfRendered="true">

            <a4j:include id="commonPageView"  viewId="/existingcustomer/postpaid/header_common_modal.jsp"></a4j:include>

            </a4j:region>

                </td>

              </tr>

              <tr>

                <td>

                <table width="958" border="0">

                  <tr>

                    <td width="122"><h:outputText styleClass="ashcolor-bold-normaltext" value="#{msg['existingcustomer.postpaid.modelpanel.currname']}"/></td>

                    <td width="540"><h:outputText styleClass="ashcolor-bold-normaltext" id="editpostpaidNameFields" value="#{customerInfoBean.name}"/></td>

                    <td width="282"> </td>

                  </tr>

                          <tr>

                        <td width="122">          

                        <h:outputText  value="*" styleClass="mandatory_text" />

                        <h:outputText styleClass="ashcolor-bold-normaltext" value="#{msg['existingcustomer.postpaid.modelpanel.newname']}"/>            

                        </td>

                        <td width="540"> 

                       <a4j:region>                    

                            <h:panelGrid columns="9" border="0">

            <h:outputText  value="*" styleClass="mandatory_text" />

            <h:outputText value="#{msg.keyword}"/>

            <h:outputText value=":" />                   

                            <h:inputText id="keywordField" size="28" label="Name" immediate="true"

                            required="true" requiredMessage="#{msg.requiredField}">                

                            <a4j:support  event="onblur"

                 limitToList="true" reRender="p_keywordField,ekeywordField"/>              

                </h:inputText>

                <a4j:outputPanel id="p_keywordField"  ajaxRendered="true">

            <h:message id="ekeywordField"  for="keywordField" styleClass="fieldError"/>

            </a4j:outputPanel>  

            </h:panelGrid>  

            </a4j:region>         

                          </td>

                    </tr>

                  <tr>

                    <td height="18"><h:outputText styleClass="ashcolor-bold-normaltext" id="notesField" value="#{msg.notes}"/>

                    <h:outputText styleClass="ashcolor-bold-normaltext" value="#{msg.semiColon}"/></td>

                    <td>       

                    <h:inputTextarea  id="nameNotesField" cols="50" rows="5" value="#{editCustomerInfoBean.nameNotes}"></h:inputTextarea>      

                    </td>

                    <td> </td>

                    </tr>

             

                </table></td>

              </tr>

              <tr>

                <td> </td>

              </tr>

            </table>

            <rich:message showSummary="true" showDetail="false" for="keywordField" />

            <h:panelGrid columns="6">

            <a4j:commandButton reRender="panelName,p_nameField,e_nameField"  limitToList="true"

                 id="saveButtonId" styleClass="celcocm01" value="#{msg.save}" type="submit"

                 oncomplete="if(#{facesContext.maximumSeverity==null})#{rich:component('info_name_editmodal')}.hide();"/>

             

            <a4j:commandButton limitToList="true"  reRender="nameinputField,p_nameField,nameNotesField"

                 type="submit" id="resetButtonId" styleClass="celcocm01" value="#{msg.reset}"

                 oncomplete="if(#{facesContext.maximumSeverity==null})#{rich:component('info_name_editmodal')}.hide();"/>

             

             

            <a4j:commandButton limitToList="true" reRender="nameinputField,p_nameField,nameNotesField"

                 type="submit" id="cancelButtonId" styleClass="celcocm01" value="#{msg.cancel}"

                 oncomplete="if(#{facesContext.maximumSeverity==null})#{rich:component('info_name_editmodal')}.hide();"/>

             

            </h:panelGrid>

            </a4j:form>

            </rich:modalPanel>

             

            It is still not displaying the error message in the screen???

             

            • 3. Re: Error message in model panel not displaying event="onblur"??
              sivaprasad9394

              How to work on with Client side?Still i am waiting for this problem.

              Thanks