rich:ListShuttle issue
shivaji.byrapaneni May 22, 2009 8:26 AMHi i tried a simple example of rich:listShuttle provided by richfaces
here is my jsp
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<!-- RichFaces tag library declaration -->
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<html>
<head>
<title>RichFaces selector demo</title>
<style>
.pic {
margin-bottom: -4px;
margin-right: 2px;
}
</style>
</head>
<body>
<f:view>
<a4j:form id="approverForm">
<rich:toolBar id="toolBar" itemSeparator="line" height="28px">
<c:forEach items="#{toolBar.items}" var="item">
<h:panelGroup>
<h:graphicImage value="#{item.iconURI}" styleClass="pic" />
<h:outputLink value="#"
style="color:#{a4jSkin.generalTextColor}; text-decoration:none;">
<h:outputText value="#{item.label}" />
</h:outputLink>
</h:panelGroup>
</c:forEach>
</rich:toolBar>
<rich:spacer height="20" />
<rich:messages />
<rich:listShuttle sourceValue="#{toolBar.freeItems}"
targetValue="#{toolBar.items}" var="items"
sourceCaptionLabel="Available Items"
targetCaptionLabel="Currently Active Items" id="listShuttle"
converter="myConverter">
<rich:column width="18">
<h:graphicImage value="#{items.iconURI}"></h:graphicImage>
</rich:column>
<rich:column>
<h:outputText value="#{items.label}"></h:outputText>
</rich:column>
<a4j:support event="onlistchanged" reRender="toolBar" />
<a4j:support event="onorderchanged" reRender="toolBar" />
</rich:listShuttle>
</f:view>
</a4j:form >
</body>
</html>
and my managed bean is this
package demo;
import java.util.ArrayList;
public class Approver {
private ArrayList<ItemVO> items = new ArrayList<ItemVO>();
private ArrayList<ItemVO> freeItems = new ArrayList<ItemVO>();
public Approver() {
items.add(new ItemVO("./Images/create_doc.gif", "Create Doc"));
items.add(new ItemVO("./Images/create_folder.gif", "Create Folder"));
items.add(new ItemVO("./Images/delete.gif", "Delete"));
items.add(new ItemVO("./Images/find.gif", "Find"));
items.add(new ItemVO("./Images/open.gif", "Open"));
items.add(new ItemVO("./Images/save_all.gif", "Save All"));
items.add(new ItemVO("./Images/save.gif", "Save"));
}
public ArrayList<ItemVO> getItems() {
return items;
}
public void setItems(ArrayList<ItemVO> items) {
this.items = items;
}
public ArrayList<ItemVO> getFreeItems() {
return freeItems;
}
public void setFreeItems(ArrayList<ItemVO> freeItems) {
this.freeItems = freeItems;
}
}
and itemVO contains just a string with the names and getters, setters to that names used in jsp.
with all the above page is getting rendered as expected but when i tried to do any operations im getting this error
"Component j_id_jsp_1561931891_1:listShuttle has invalid value expression demo.ItemVO@139deb9"
and was unable to move from that screen
please help
Thanks in advance