3 Replies Latest reply on Feb 19, 2010 5:01 AM by psini

    invalid value expression listshuttle [ RichFaces 3.3.3CR1]

      I have the previous error (invalid value expression  ) in a listshuttle only when i load the targetValue with a non empty list an tyrying to save the changes tha the user have done to the list .

      <rich:listShuttle id="pkl" sourceValue="#{assegnaCoordinatori.listaProvinceDaAssegnare}"
                  targetValue="#{assegnaCoordinatori.listaProvinceAssegnate}" var="items" listsHeight="150"
                  sourceListWidth="130" targetListWidth="130" sourceCaptionLabel="Province Da Assegnare"
                  targetCaptionLabel="Province Assegnate al rilevatore selezionato"
                  converter="ENTCONV_UT"  fastOrderControlsVisible="false"  orderControlsVisible="false" sourceRequired="false" targetRequired="false" 
                  > 
                  
                  <rich:column>
                      <h:outputText value="#{items.nomeProv}"></h:outputText>
                  </rich:column>
                 
                  <a4j:support event="onlistchanged" action="#{assegnaCoordinatori.modified}" immediate="true" />  
              </rich:listShuttle>
      

       

      The simptom is thatwhen i load the listShuttel with empty list is all ok

      #{assegnaCoordinatori.listaProvinceAssegnate}

      while if the list is not empty i get the error:

       

      sourceId=j_id46:pkl[severity=(ERROR 2), summary=("Component j_id46:pkl has invalid value expression utenti.hibernate.Province@bab0"), detail=("Component j_id46:pkl has invalid value expression utenti.hibernate.Province@bab0")]
      

       

      The behind code in the managed bean is :

      List<Province> listaProvinceDaAssegnare;
          List<Province> listaProvinceAssegnate;

       

      and a init in the costructor

       

      listaProvinceAssegnate=afacade.getProvincieAssegnateCoordinatori(getUser().getId(),selectedCoordinatore);

      istaProvinceDaAssegnare=afacade.getProvincieDaAssegnareCoordinatori(getUser().getId());

       

      I had already checked my converter that don't thow any Exception

      so which can be the problem?

        • 1. Re: invalid value expression listshuttle [ RichFaces 3.3.3CR1]

          With more time i noticed that this happens where the listshuttle is reRerendered from another component:

          another example is :

          <h:form >
           <h:outputText value="Coordinatori "/><br />
                   <h:selectOneListbox id="coordinatori" value="#{assegnaCoordinatori.selectedCoordinatore}"    converter="ENTCONV_UT"  validator="ENTVAL" immediate="true" styleClass="select_style">
                              <s:selectItems value="#{assegnaCoordinatori.listaCoordinatori}" var="age" label="#{age.codFisc}"   />
                   <a4j:support event="onchange"     action="#{test.onSelectCoordinatore}" reRender="tes"    >
                       
                   </a4j:support>
                   </h:selectOneListbox>
           <rich:listShuttle id="tes" targetValue="#{test.listaOut}" sourceValue="#{test.listaIn}" var="items" fastOrderControlsVisible="false"  orderControlsVisible="false" sourceRequired="false" targetRequired="false">
           
            
                      <rich:column>
                          <h:outputText value="#{items}"></h:outputText>
                      </rich:column>
                     
                      <a4j:support event="onlistchanged" action="#{test.save}" immediate="true" />  
                      
           </rich:listShuttle>
           </h:form>
          
          

           

          and the test bean is :

           

          public List<String> listaIn;
              public List<String> listaOut;
              public test() {
                  super();
                  listaIn= new ArrayList<String>();
                  listaOut=new ArrayList<String>();
                  listaIn.add("A");
                  listaIn.add("B");
                  listaIn.add("C");
                  listaOut.add("D");
                  
                  
              }
              public List<String> getListaIn() {
                  return listaIn;
              }
              public void setListaIn(List<String> listaIn) {
                  this.listaIn = listaIn;
              }
              public List<String> getListaOut() {
                  return listaOut;
              }
              public void setListaOut(List<String> listaOut) {
                  this.listaOut = listaOut;
              }
              
              public void save(){
                  
                  return;
              }
              
              public void onSelectCoordinatore(){
                  listaOut.add("K");
                  return;
              }
          

           

          and the error :

           

          sourceId=j_id62:tes[severity=(ERROR 2), summary=("Component j_id62:tes has invalid value expression K"), detail=("Component j_id62:tes has invalid value expression K")]
          
          • 2. Re: invalid value expression listshuttle [ RichFaces 3.3.3CR1]
            ilya_shaikovsky

            For the second case - you have no converter at all.

            for the first case - I gues converter just works in wrong way or equals() and hasCode() methods implemented wrong. This thread was risen many times at this forum and it's always had a solution by just debugging converter methods.

             

            Provide simple war sample for investigation if will not be able to solve on your own.

            • 3. Re: invalid value expression listshuttle [ RichFaces 3.3.3CR1]

              the solution is to use a <a4j:keepAlive> with  the bean name .

               

              Thanks a lot.