[jboss-user] [JBoss Seam] - Select item from table and convertEntity

brachie do-not-reply at jboss.com
Tue Jan 22 18:53:11 EST 2008


Hi,

I have a use case to implement which could normally done with a <h:selectOneMenu> and <s:convertEntity />. 
Imagine you have a project editing page where I can set the manager of a project. Normally this could be done with a drop-down list like:

<h:selectOneMenu value="#{project.manager}">
  |      <s:convertEntity />
  |      <s:selectItems value="#{allPersons.resultList}" 
  |                                        var="person"
  |                                        label="#{person.name}"/>
  | </h:selectOneMenu>

So the <s:converEntity/> will automatically converts the selected person and set it to my project (project hast a setManager(Person p) method).

But what if the data-list (here: allPersons.resultList) is too big to show it in the drop-down list? Let's say the list has 100000 entries.. In this case a popup should appear where I can search for persons, see the results in a table where I can select one to set for the project.
How could I accomplish that? Is there a way to use the <s:convertEntity> here or would I need to grab the id of the selected person manually and set it to the entity before saving it?

I think this is a common use case in real-world applications, so maybe one of you can give me a hint on how to implement it with Seam/JSF possibilities.

Thanks,

Alexander 


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

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



More information about the jboss-user mailing list