3 Replies Latest reply on Apr 24, 2012 12:45 PM by 615994

    Putting business validation on input text columns of adf table

    615994
      Hi ,

      I have a requirement where in on click of submit button , i want validation of all rows in a table .

      eg
      name | minsize |max size
      abc | 2 | 6
      cde | 8 | 5
      rfe | 12 | 4

      Validation TODO -> max column value should always be greater than min col value

      Please note that minsize column and max size is editable input text feild binded to maned bean
      eg:
      <af:table value="#{pageFlowScope.crsPolicy.serverpools}"
      var="row" columnStretching="last"
      emptyText="#{crsclusteruiBundle.NO_DATA_DISPLAY}"
      fetchSize="25" rowBandingInterval="0"
      rowSelection="none" id="t2b"
      binding="#{crsPolicySetVO.addPolicySrvpTable}">
      <af:column sortProperty="name" sortable="true"
      headerText="#{crsclusteruiBundle.SERVER_POOL_NAME}"
      shortDesc="#{crsclusteruiBundle.SERVER_POOL_NAME}"
      id="c9b">
      <af:inputText value="#{row.name}" readOnly="true"
      shortDesc="#{crsclusteruiBundle.SERVER_POOL_NAME}"
      id="it6b"></af:inputText>
      </af:column>
      <af:column sortProperty="minSize" sortable="true"
      headerText="#{crsclusteruiBundle.SP_MINSIZE_COL}"
      id="c8b"
      >
      <af:inputText value="#{row.minSize}"
      id="it2b"
      shortDesc="#{crsclusteruiBundle.MINSIZE_TIP}"
      binding="#{viewScope.crsPolicyVO.serverpoolMinSize}">
      <af:validateRegExp pattern="[0-9]{1,10}"
      messageDetailNoMatch="#{crsclusteruiBundle.VALIDATE_NUMBERS_MSG}"/>
      </af:inputText>
      </af:column>
      <af:column sortProperty="maxSize" sortable="true"
      headerText="#{crsclusteruiBundle.SP_MAXSIZE_COL}"
      id="c12b">
      <af:inputText value="#{row.maxSize}"
      id="it5b" autoSubmit="true"
      shortDesc="#{crsclusteruiBundle.MAXSIZE_TIP}"
      binding="#{viewScope.crsPolicyVO.serverpoolMaxSize}">
      <f:validator validatorId="CRSPolicyMaxgtMinSizeValidator"/>
      </af:inputText>
      </af:column>
      </af:table>

      The backingbean crsPolicyVO hold bindings and is view scoped.
      CrsPolicy is value managed bean in pageFlowScope.
      Now in CRSPolicyMaxgtMinSizeValidator , how could I access user inputs of min and max columns ?
      Is there a way I could bind each row inputtext to separate richInputtext ?

      Any help is highly appreciated .