rich:listShuttle has invalid value expression
spiritfox26 Nov 8, 2010 9:41 AMHello, i'm trying to make work this component but i can't do it. I'm recieve this error "Component addIncidenteForm:shuttleCIsAfectados has invalid value expression xxx". My Converter, equals and hashCode methods are fine. The listShuttle load the values correctly but when i'm submit the page with a h:commandLink the error appear.
I search in google and JBoss forum but not found the solution.
The page code:
<rich:listShuttle id="shuttleCIsAfectados" targetValue="#{incidenteEditBean.configurationsItemsResult}" listsHeight="375px" sourceListWidth="180px"
sourceValue="#{incidenteEditBean.configurationsItemsAll}" targetListWidth="180px" copyAllControlLabel="#{msg.copiarTodosLabel}" copyControlLabel="#{msg.copiarLabel}"
removeAllControlLabel="#{msg.removerTodosLabel}" removeControlLabel="#{msg.removerLabel}" fastOrderControlsVisible="false"
orderControlsVisible="false" converter="listShuttleConverter" var="items" sourceSelection="#{incidenteEditBean.ciActivos}">
<rich:column>
<h:outputText value="#{items.nombreCodigoCI}"/>
</rich:column>
</rich:listShuttle>
<rich:listShuttle id="shuttleCIsAfectados" targetValue="#{incidenteEditBean.configurationsItemsResult}" listsHeight="375px" sourceListWidth="180px" sourceValue="#{incidenteEditBean.configurationsItemsAll}" targetListWidth="180px" copyAllControlLabel="#{msg.copiarTodosLabel}" copyControlLabel="#{msg.copiarLabel}" removeAllControlLabel="#{msg.removerTodosLabel}" removeControlLabel="#{msg.removerLabel}" fastOrderControlsVisible="false" orderControlsVisible="false" converter="listShuttleConverter" var="items" sourceSelection="#{incidenteEditBean.ciActivos}" <rich:column> <h:outputText value="#{items.nombreCodigoCI}"/> </rich:column> </rich:listShuttle>
The converter code:
public class ListShuttleConverter implements Converter{ public Object getAsObject(FacesContext fc, UIComponent ui, String value) { ConfigurationItem ci = new ConfigurationItem(); String[] str = value.split(":"); ci.setIdConfigurationItem(Integer.parseInt(str[0])); ci.setCodConfigurationItem(str[1]); return ci; } public String getAsString(FacesContext fc, UIComponent ui, Object value) { ConfigurationItem optionItem = (ConfigurationItem) value; return Integer.toString(optionItem.getIdConfigurationItem()) + ":" + optionItem.getCodConfigurationItem(); } }
the hasCode and equals:
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + idConfigurationItem; return result; } @Override public boolean equals(Object obj) { if (this == obj){ return true; } if (obj == null){ return false; } if (getClass() != obj.getClass()){ return false; } ConfigurationItem other = (ConfigurationItem) obj; if (idConfigurationItem != other.idConfigurationItem){ return false; } return true; }
I need help.
Thanks in advanced!
Regards