2 Replies Latest reply on Nov 26, 2008 7:09 AM by paul.williams

    reRender

    paul.williams

      Hi !

      Assume I have two <h:inputText>

      1. For Name
      2. For Age

      with required attribute set to true i.e. required="true".

      When I submit the form with <a4j:commandLink> without setting the value for Age i get the correct error message for Name that I need to set values, from the requiredMessage.
      When i try to now reRender with some value from the request scope, the already set bean value of Name is not getting reRendered properly, instead it is getting the value from the previous request. Can anyone help me on this.

        • 1. Re: reRender
          ilya_shaikovsky

          show your page code.

          • 2. Re: reRender
            paul.williams

             

            <h:panelGrid columns="1" bgcolor="#FFFFFF" width="100%" columnClasses="heightClass2" cellpadding="0" cellspacing="0" >
             <h:panelGroup>
            
             <h:panelGrid columns="2" id="valuesList">
             <h:panelGroup>
             <h:outputText value="Student Name : " />
             <h:inputText value="#{student.name}"/>
             </h:panelGroup>
             <h:panelGroup>
             <h:outputText value="Student Age : " />
             <h:inputText value="#{student.age}"/>
             </h:panelGroup>
             <a4j:commandButton value="Add" action="#{statioHandler.addData}" reRender="valuesList,dataTable"/>
             </h:panelGrid>
            
             <a4j:region id="dataTableRegion">
             <h:panelGrid columns="1" width="100%" bgcolor="#FFFFFF">
             <h:panelGroup>
             <rich:dataTable width="100%" border="0" cellpadding="0"
             cellspacing="0" id="dataTable"
             value="#{student.studentList}"
             var="student">
            
             <rich:column styleClass="td_text" style="text-align:center;">
             <f:facet name="header">
             <h:outputText value="Select" />
             </f:facet>
             <h:panelGrid cellpadding="0" cellspacing="0" width="40px" columns="2" border="0" style="padding-left:5px;padding-right:5px;">
             <a4j:commandLink action="#{studentHandler.updateData}" reRender="valuesList">
             <h:graphicImage value="../../images/edit.JPG" width="15" height="15" alt="Update"></h:graphicImage>
             </a4j:commandLink>
             </h:panelGrid>
             </rich:column>
            
             <rich:column >
             <f:facet name="header">
             <h:outputText value="Student Name" />
             </f:facet>
             <h:outputText value="#{student.name} " />
             </rich:column>
            
             <rich:column >
             <f:facet name="header">
             <h:outputText value="Student Age" />
             </f:facet>
             <h:outputText value="#{student.age} " />
             </rich:column>
             </rich:dataTable>
             </h:panelGroup>
             </h:panelGrid>
             </a4j:region>
            
             </h:panelGroup>
            </h:panelGrid>