You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Clément Maignien <c....@edic-syliance.com> on 2005/08/09 11:15:17 UTC

Strange behaviour

Hi,
I use a <x:selectOneRadio> component in one of my application pages. This page allow the user to specify research criteria. The <x:selectOneRadio> is one of them.
My page is divided in a panelGroup where I add all the criteria components and a form with a commandButton to throw the research.
Here is the JSF code snipet of the selectOneRadio :
            <h:outputLabel for="qstockradio" value="#{res['stock_Etat_Crit_QStock']}"/>
            <x:selectOneRadio id="qstockradio" binding="#{stockBean.quantStock}">
                    <f:selectItems id="choixqstock" value="#{stockBean.choixQuantStock}"/> 
            </x:selectOneRadio>
As you can see the component is bind to the quantStock attribute of my stockBean (quantStock is an instance of the HtmlSelectOneRadio class).
When the commandButton is clicked by the user, the associated action get all the user criteria to query the database.
 
Here comes the strange behaviour :
If I put the selectOneRadio component inside the panelGroup, I'm unable to get its right value (always get the initial value).
However, if I put the selectOneRadio component inside the form, I get the right one (the one that the user choose), with exactly the same code in my action ( criteria.add(quantStock.getValue().toString()); )
 
Is it the good way to get the selected value of a selectOneRadio component ? Why doesn't it behave the same way in both case ?
 
Regards,
Clément.