[jboss-user] [JBoss Seam] - No selected element from <h:selectOneListbox>

haefti do-not-reply at jboss.com
Fri Jan 11 11:44:25 EST 2008

I have a problem to get the selected element from a select box.
I would like to have a list of items and a button which leads to a page where I can edit the values of the selected element.

  | <h:selectOneListbox size="10">
  |   <s:selectItems value="#{videos}" var="video" label="#{video.name}" />
  |   <s:convertEntity />
  | </h:selectOneListbox>
  | <h:commandButton type="submit" action="#{manager.editVideo()}" value="Change"></h:commandButton>

If I do not choose anything and press the button the first element is chosen (I can see the id of the selected item in the log) but if I choose an element the method manager.editVideo() is not called and the page is rendered again.
(I know someone reported this kind of problem here in the forum but I can't find the posting any more.)

My second problem is how to go on with it to come to the edit page.

I have an edit.xhtml where I can edit the values of each item (video) which works pretty good if I use a data table with a link and the id as parameter instead of the select box above..
How do I do this from the select box? Is it right that I need the editVideo() method as action for the command button even though the method does nothing but logging the id of the selected element at the moment?

Is this code from my pages.xml already wrong?

  | <page view-id="/edit.xhtml" action="#{manager.editVideo}"/>

Thanks for your help!


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

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

More information about the jboss-user mailing list