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