10 Replies Latest reply on Feb 25, 2009 5:10 PM by Guillaume Jeudy

    ListShuttle and validation

    Guillaume Jeudy Master

      Hi,

      I'm trying to validate values in my listShuttle. The listShuttle is working fine without any validation.

      <rich:listShuttle id="toRelShuttle"
       targetValue="#{relatedToInstances}"
       sourceValue="#{unrelatedToInstances}"
       targetCaptionLabel="Related Ref Domain Instances"
       sourceCaptionLabel="Unrelated Ref Domain Instances"
       fastOrderControlsVisible="false" orderControlsVisible="false"
       listsHeight="400px" sourceListWidth="400px" targetListWidth="400px"
       copyAllControlLabel="Relate All" copyControlLabel="Relate"
       removeAllControlLabel="Unrelate All" removeControlLabel="Unrelate"
       converter="#{my.web.converter.IdentifiableConverter}"
       var="domInstVO"
       validator="businessKeyBatchingValidator">
       <h:column>
       <f:facet name="header">
       <h:outputText value="Id" />
       </f:facet>
       <h:outputText value="#{domInstVO.referenceDomainInstance.id}" />
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="Name" />
       </f:facet>
       <h:outputText
       value="#{domInstVO.referenceDomainInstance.description}" />
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="Code" />
       </f:facet>
       <h:outputText
       value="#{domInstVO.referenceDomainInstance.codeValue}" />
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="Valid From Dt" />
       </f:facet>
       <h:inputText id="validFromDt"
       value="#{domInstVO.validityPeriod.validFromDate}"
       />
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="Valid To Dt" />
       </f:facet>
       <h:inputText id="validToDt"
       value="#{domInstVO.validityPeriod.validToDate}"
       />
       </h:column>
       </rich:listShuttle>
      .

      I'm using Richfaces 3.2.1.GA. I notice that the JSF validator validate() method is called twice the first time the value passed is a List representing what I have in sourceValue, the 2nd time targetValue. That is a little ackward but I can live with that.

      However, if I change a value in my h:inputText on one of the rows for example, I submit and this changed value is not reflected in JSF validator validate() method.

      PS: I properly implemented equals() and hashCode() on my value object.

      Is this is a bug?

      Thanks,
      -Guillaume