0 Replies Latest reply on Apr 14, 2008 7:01 PM by Paul Pantages

    listShuttle and @In

    Paul Pantages Novice

      seamversion: 2.0.1.GA
      richfaces
      version: 3.1.4.GA


      Hello Forum,


      I have an odd problem with listShuttle, when I use @In/Out on the value of
      the sourceValue. I am going to cross-post this to richfaces-users forum also.


      When moving values back from the targetValue to sourceValue, I would get
      a validation error something like this:


      2008-04-07 18:59:13,399 INFO  [http-0.0.0.0-8080-1] javax.enterprise.resource.webcontainer.jsf.lifecycle
      WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
      sourceId=j_id30:j_id286[severity=(ERROR 2), summary=(j_id30:j_id286: Validation Error: Value All is not valid), detail=(j_id30:j_id286: Validation Error: Value All is not valid)]
      
      



      The root of it all was that, when I submit my form, richfaces fails to
      write the value of sourceValue. I verified this by putting
      printlns in the setter for sourceValue, and I can see that ths setter is not called
      when the form is submitted.


      However, if I drop the @In/@Out and just use conventional getter/setter
      in my @Local interface, the problem goes away.


      The thing is, I have other listShuttle objects, where I use @Out/In w/o any problems.
      I cannot find any difference between the implementation of this and the other cases.
      Believe me, I looked.


      My backing bean is a SFSB, CONVERSATION scope.


      Someone once posted a question asking if there was a limit on the
      number of Seam components one may define.  This was never answered in
      the forum. I have about 190, and thought I might be running into some
      limit or something? I kind of doubt this, but I would like to take
      this off the table as a possiblity.


      Any other ideas as to what the problem might actually be would be
      greatly appreciated, as I am completely stumped at this point.



      Original Code: (doesn't work)



      BEAN:
      
      @In(required=false)
      @Out    
      private List<AlarmSuppressionPolicy> availableAlarmSuppressionPolicies;
      
      Xhtml:
      
      <rich:listShuttle 
         sourceValue="#{availableAlarmSuppressionPolicies}"
         targetValue="#{serviceEntry.alarmSuppressionPolicies}"
         var="row"
         listClass="scroll_container"
         sourceCaptionLabel="Available Policies"
         targetCaptionLabel="Enforced Policies"
         removeAllControlLabel="Remove all policies"
         removeControlLabel="Remove policy"
         copyControlLabel="Add policy"
         copyAllControlLabel="Add all policies"
         listsHeight="30em"
         sourceListWidth="45em"
         targetListWidth="45em"
         converter="#{availableAlarmSuppressionPolicyMgmt.alarmSuppressionPolicyConverter}">
         
         <rich:column sortable="false">
      
            <f:facet name="header">
               <h:outputText 
                  class="sortLink"
                  value="Name"/>
            </f:facet>
      
            <h:outputText value="#{row['name']}"/>
      
         </rich:column>
      
      </rich:listShuttle>
      




      New Code (works)


      BEAN:
          public List<AlarmSuppressionPolicy> getAlarmSuppressionPolicies() {
              return this.alarmSuppressionPolicies;
          }
      
          public void setAlarmSuppressionPolicies( List<AlarmSuppressionPolicy> alarmSuppressionPolicies ) {
              this.alarmSuppressionPolicies = alarmSuppressionPolicies;
          }
      
      Xhtml:
      
         ...
         sourceValue="#{availableAlarmSuppressionPolicyMgmt.alarmSuppressionPolicies}"
         ...