0 Replies Latest reply on May 31, 2011 8:17 AM by Rajib Jana

    Bean Validation within data table

    Rajib Jana Newbie

      Hello, I was trying to use bean validation within a rich data table. While the bean validation is working inside a form, the validation messages are not displaying while moving out of a field.

       

      Here is the code snippet:

       

      create.xhtml

      ------------------

       

      <h:panelGrid columnClasses="acent" id="dtPagenate">

                         <rich:dataTable id="dt"

                          value="#{wbSaCategoryMastController.wbSaCategoryMasts}" var="item"

                          rows="10" style="width:100%;"

                          onRowMouseOver="this.style.backgroundColor='silver'"

                          onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">

                          <h:column>

                              <f:facet name="header">

                                  <h:outputText value="#{bundle.ListWbSaCategoryMastTitle_catIId}" />

                              </f:facet>

                              <h:outputText value="#{item.catIId}" />

       

                          </h:column>

                          <h:column>

                              <f:facet name="header">

                                  <h:outputText

                                      value="#{bundle.ListWbSaCategoryMastTitle_catCCode}" />

                              </f:facet>

                              <ui:fragment rendered="#{item.catCCode != '' }">

                                  <h:outputText value="#{item.catCCode}" />

                              </ui:fragment>

                              <ui:fragment rendered="#{item.catCCode == null }">

                                  <h:inputText value="#{item.catCCode}" validatorMessage="bad email">

                                  <rich:validator />

                                  </h:inputText>

                              </ui:fragment>

                          </rich:dataTable>

                     </h:panelGrid>

       

      The above datatable is inside a h:form. Please help.