[jboss-user] [JBoss Seam] - Re: selectOneMenu with s:selectItems problem
smithbstl
do-not-reply at jboss.com
Fri Sep 28 17:48:35 EDT 2007
Well it looks like you are trying to pass an entity to a String.
Why does user have an areaID property? If user has a many to one M:1 relationship with area, shouldn't it just have an area property? This is assuming these are both entities.
So how about something like this
<h:outputLabel>areaID</h:outputLabel>
| <h:selectOneMenu value="#{createuser.user.area}" id="areaID">
| <s:selectItems value="#{areas.resultList}" var="ar" label="#{ar.areaName}" hideNoSelection="true" noSelectionLabel="Please Select..."/>
| <s:convertEntity />
| </h:selectOneMenu>
You need to change your User entity to properly map area.
Something like this
| @Entity
| public class User {
| ...
|
| @JoinColumn(name="AREA_ID", referencedColumnName="AREA_ID")
| @ManyToOne
| private Area area;
| ...
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089882#4089882
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089882
More information about the jboss-user
mailing list