JSF/Seam - call one component method for many radio groups

Posted by purecharger on Stack Overflow See other posts from Stack Overflow or by purecharger
Published on 2010-03-22T15:54:31Z Indexed on 2010/03/22 16:01 UTC
Read the original article Hit count: 322

Filed under:
|
|

I've got the following jsf page:

    <h:form>
        <ui:repeat value="#{list.categories}" var="cat">
            <h:selectOneRadio id="sel1Rad" value="#{list.choose}" layout="pageDirection">
                <f:selectItems value="#{list.names}"/>
            </h:selectOneRadio> 
        </ui:repeat>
        <h:commandButton id="submit" action="#{list.submit}" value="Submit"/>
    </h:form>

And a component named list. The variable cat is injected to the component, used by the method list.getNames(). What I am trying to have happen is to have list.choose() be called for each radio group. I'm not sure if this is possible with Seam. Going by the booking example distributed with Seam, there is a distinct separate method for each selectOneRadio or selectOneMenu group.

Since I have an unknown number of categories, I can't / don't want to define a method for each possible choice.

When I submit the form, all my choices are sent in the POST, I just don't know the correct way to tell Seam how to dispatch them to my component.

Any help is appreciated!

© Stack Overflow or respective owner

Related posts about java

Related posts about seam