myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From monkeyden <>
Subject Submitting using SelectOneRadio
Date Mon, 30 Oct 2006 19:16:16 GMT

Im using this wiki example to submit a form from a radio button: 

The submit itself is working flawlessly and everything described in the
example is fine.  I was wondering how I could also get the value of the
selected radio button passed to the listener method as well.  I happen to be
using JBoss Seam components as the business layer, but the main question is,
how can I get the radio's value to submit as well?  I've implemented it as

The listener method:
@RequestParameter private String selectedState;

public String getSelectedState() {
    return selectedState;
public void setSelectedState(String selectedState) {
    this.selectedState = selectedState;

public String locationsByState(){
    availableLocations = new ArrayList<SelectItem>();
    for(int i=0;i<staticLocations.size();i++){
        SelectItem current = staticLocations.get(i);
    return display();        

The View.  radioSubmit is generating the JS event as in the example:
<h:selectOneRadio value="#{editProfileAction.selectedState}"
onmouseup="radioSubmit('hiddenLink');" styleClass="bodyCopy"
    <f:selectItem itemLabel="MA" itemValue="MA"/>
    <f:selectItem itemLabel="ME" itemValue="ME"/>
    <f:selectItem itemLabel="NH" itemValue="NH"/>
    <f:selectItem itemLabel="RI" itemValue="RI"/>
    <f:selectItem itemLabel="VT" itemValue="VT"/>

<t:commandLink id="hiddenLink" forceId="true" style="display:none;
visibility: hidden;" action="#{editProfileAction.locationsByState}">

Thanks for any suggestions
View this message in context:
Sent from the MyFaces - Users mailing list archive at

View raw message