[jboss-user] [JBoss Seam] - Re: How to use si:selectItems with an object that has a Stri

lawrieg do-not-reply at jboss.com
Wed Jan 31 16:48:22 EST 2007


I stepped through the code and you are quite right that the first CampaignType object passed to BasicEntityConverter's getIdAsString method has null values in its fields.

If I modify the BasicEntityConverter code to not throw an exception, then I see that on the second and third calls to the getIdAsString method, the entity argument contains the CampaignType objects I would expect.

customerTypes.resultList is populated by a Seam Application Framework Entity-Query:

<framework:entity-query name="customerTypes" ejbql="select customerType from CustomerType customerType" />
  | 

I've checked that my entity-query only returns two CustomerType objects which have non-null id values.

My si:selectItems tag is as follows:

<h:selectOneMenu value="#{customerHome.instance.customerType}" id="customerType">
  |   <si:selectItems value="#{customerTypes.resultList}" var="customerType" label="#{customerType.name}" noSelectionLabel="Please Select..." />
  | </h:selectOneMenu>	

So now I'm more than a bit confused as to how a CustomerType with a null id value is being passed to BasicEntityConverter's getIdAsString method.

Does the object from the <h:selectOneMenu> value property get passed to the BasicEntityConverter??? The reason I ask is because I'm creating a new Customer and therefore #{customerHome.instance.customerType} would initially contain a new instance of CustomerType. If so, how do you work around this?

Any help would be very much appreciated as I'm starting to tear my hair out...

Cheers,

Lawrie

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009047#4009047

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009047



More information about the jboss-user mailing list