Hi,

The h:commandLink is immediate. That means that it is *completely* processed before the h:selectOneRadio component gets processed at all.

So you won't see any updated model values in the actionListener method associated with the commandLink. In fact, as the commandLink always does navigation to the action destination, the radio value will *never* get pushed into the model.

If you want to validate your components and push them into the model before doing any navigation, set immediate to false.

Regards,

Simon

Emily Gu wrote:
Sorry, that was a typo. It is a setter method. Do you see anything else wrong? Thanks!!

On 12/18/05, *Simon Kitching* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Emily Gu wrote:
     > Here is my code:
     >
     > jsp page:
     >
     > <f:view>
     >    <h:form>
     >        <h:selectOneRadio value=" #{choice.choiceEntry}">
     >           <f:selectItems value="#{choiceList.choiceMap} "/>
     >       </h:selectOneRadio>
     >
     >       <h:commandLink immediate= "true" value="Create"
     > action="#{choice.createEntry} " />
     >
     >    </h:form>
     > </f:view>
     >
     > Bean:
     >
     > public class Choice {
     >    private String choiceEntry;
     >
     >    public Choice () { }
     >    public void getChoiceEntry () { return choiceEntry;}
     >    public String getChoiceEntry (String e) ( choiceEntry = e;}
     >
     >    public void createEntry () { System.out.println (choiceEntry); }
     > }
     >
     > In the createEntry method, I just want to see the value of changed
     > choices. It is always null. The initial value is null, that is
    fine, why
     > after I made selection, then click the "Create" command link,
     > the returned page had correctly remembered the selection, but the
     > console printout is null all the time. Thanks for your help.

    Is this really what's in your code:
     >    public String getChoiceEntry (String e) ( choiceEntry = e;}

    If so, that would explain your problem: no setter method.

    Cheers,

    Simon



Reply via email to