0 Replies Latest reply on Jun 21, 2011 11:37 AM by langer123

    listshuttle Converter problems

    langer123

      I have the following converter:

       

      public class TomsShuttleListConverter implements Converter

      {

                public Object getAsObject(FacesContext context, UIComponent component,String value) throws ConverterException

                { 

                          SelectItem items = new SelectItem();

       

                          items.setValue(value);

       

                          return items;

       

                } 

       

       

                public String getAsString(FacesContext context, UIComponent component,Object value) throws ConverterException

                { 

                          SelectItem items = (SelectItem) value;

       

       

                          return beanItems.getValue().toString();

                } 

       

      }

       

      And the following list shuttle:

       

      <rich:listShuttle sourceValue="#{MyBean.filteredFieldsList}" sourceSelected="MyBean.selectedCDFFields"

                                      targetValue="#{MyBean.allSelectedCDFFields}" targetSelected="MyBean.deSelectedCDFFields" converter="TomsShuttleListConverter"

                                      listsHeight="180" sourceListWidth="260" targetListWidth="260" sourceCaptionLabel="Available Items" var="selectItems"

                                      fastOrderControlsVisible="false" fastMoveControlsVisible="false" targetCaptionLabel="Currently Active Items"

                                      copyControlClass="largerBtn" onclick="requiredField(this);">

      I can see calls going into the getAsString and working correctly. But when the getAsObject method is called I get the following error:

       

       

      Component customTypeForm:j_id1914 has invalid value expression javax.faces.model.SelectItem@7a1d7b72

       

       

      Is it something to do with the way I'm creating my object? I can see it is going into the getAsObject method.

       

      Thanks