[jboss-user] [JBoss Seam] - Learning to use s:selectItems
mikeeprice
do-not-reply at jboss.com
Tue Aug 21 11:15:58 EDT 2007
Using jboss-4.2.1.GA and jboss-seam-2.0.0.BETA1
Given in peoplePopup.xhtml
...
<h:selectOneMenu>
<s:selectItems value="#{allPeople}" var="n" label="#{n.name}" />
</h:selectOneMenu>
...
in PersonManagerAction.java
...
@DataModel
private List allPeople;
@DataModelSelection(value="allPeople")
private Person selectedPerson;
...
allPeople has an @Factory method and the list pops up fine showing the names from all the Person entities and lets me make the selection
then the following is executed from a commandButton in peoplePopup.xhtml
public void selectTest()
{
System.out.println("******* selectTest Name= "+selectedPerson.getName());
}
always prints out the first item in the selection list regardless of which one I selected.
So I am thinking this is not the way to do this. I think it would be cool though.
In other words select a name in the popup list and have the selected value be the associated Person entity object.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076358#4076358
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076358
More information about the jboss-user
mailing list