targetvalue is not update in the bean
mpelaez Mar 12, 2010 9:06 AMHi, I am using Seam 2.1.1, JBoss 4.2.2, RichFaces 3.3.1, EJB 3.0, Facelets y JSF. My problem is that the rich:listshuttle component is not working, the target is always empty. My client component moves the selected component from one side to another. The problem is that my selectedItems ArrayList, in my backing bean remains empty. Here you have the code:
XHTML page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<h:form id="formA">
<rich:listShuttle id="aa" sourceValue="#{jodete.sourceList}" targetValue="#{jodete.targetList}" var="items">
<rich:column>
<h:outputText value="#{items}" />
</rich:column>
<a4j:support event="onlistchanged" reRender="bb,cc"/>
</rich:listShuttle>
<h:outputText value="#{jodete.targetList.size()}" id="cc" />
<rich:listShuttle id="bb" sourceValue="#{jodete.targetList}" targetValue="#{jodete.sourceList}" var="q">
<rich:column>
<h:outputText value="#{q}" />
</rich:column>
</rich:listShuttle>
</h:form>
</ui:composition>
Bean:
import java.util.ArrayList;
import java.util.List;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Begin;
import org.jboss.seam.annotations.Create;
import org.jboss.seam.annotations.End;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
@Name ("jodete")
@Scope(ScopeType.CONVERSATION)
public class Jodete {
private List<String> sourceList;
private List<String> targetList;
@Begin(join=true)
@Create
public void InitJodete(){
sourceList=new ArrayList<String>();
targetList=new ArrayList<String>();
sourceList.add("aaa");
sourceList.add("bbb");
sourceList.add("ccc");
}
public List<String> getSourceList() {
return sourceList;
}
public void setSourceList(List<String> sourceList) {
this.sourceList = sourceList;
}
public void setTargetList(List<String> targetList) {
this.targetList = targetList;
}
public List<String> getTargetList() {
return targetList;
}
}
Can somebody help me please??? It is urgent.