I have a form which has a input text and a set of radio buttons. When a radio button is clicked I am invoking a value change listener. Inside the value change listener I am printing the value user has entered in the input text field. But I always get the older value of the text field and not the new value which the user is entering. I understand that ValueChangeListener comes under the Validation cycle. But if I need to access the new value of the input field what should I do? Note: The managed bean is request scope. If I change the scope to session, it works fine. Any explanation on this would be welcome. The code in JSP is as below:
<h:form>
Enter name:<h:inputText value="#{employee.empId}"></h:inputText>
Choose option: <h:selectOneRadio onclick="this.form.submit()"
valueChangeListener="#{employee.check}" >
<f:selectItem itemLabel="one" itemValue="one"/>
<f:selectItem itemLabel="two" itemValue="two"/>
</h:selectOneRadio>
</h:form>