0 Replies Latest reply on Jun 16, 2011 11:42 AM by Srikanth Rajkumar

    Error Validation Using a4j:support within extended data table

    Srikanth Rajkumar Newbie

      I am facing an issue when using a4j:support to validate controls inside the extended data table.

      I cannot use rich:ajaxValidator because i need to call an action method when the control is changed. This action is responsible for storing the edited rows in the table.

       

      The list is populated with correct values. Once the value is blanked, the error icon switches to a different column.

      I have attached the screen shot for reference.

       

       

      <rich:extendedDataTable value="#{person.addressList}" var="address" rowKeyVar="row">
          <rich:column width="200px">
              <f:facet name="header">
                  <h:outputText value="city"/>
              </f:facet>
              <h:inputText id="city" value="#{address.city}" required="true">
                  <a4j:support event="onchange" ajaxSingle="true" action="recordEdited" />
              </h:inputText>
              
              <rich:message for="city" showSummary="false" showDetail="false">
                  <f:facet name="errorMarker">
                      <h:graphicImage id="msg_error_img1" value="/images/error.gif">
                          <rich:toolTip for="msg_error_img1">    
                              <rich:message for="city" />
                          </rich:toolTip>
                      </h:graphicImage>
                  </f:facet>
              </rich:message>
          </rich:column>
          <rich:column width="200px">
              <f:facet name="header">
                  <h:outputText value="zip"/>
              </f:facet>
              <h:inputText id="zip" value="#{address.zip}" required="true">
                  <a4j:support event="onchange" ajaxSingle="true" action="recordEdited" />
              </h:inputText>
              
              <rich:message for="zip" showSummary="false" showDetail="false">
                  <f:facet name="errorMarker">
                      <h:graphicImage id="msg_error_img2" value="/images/error.gif">
                          <rich:toolTip for="msg_error_img2">    
                              <rich:message for="zip" />
                          </rich:toolTip>
                      </h:graphicImage>
                  </f:facet>
              </rich:message>
          </rich:column>
      </rich:extendedDataTable>