Simple component binding/JSF lifecycle question

As a JSF newbie, I ran into an unexpected component binding state/JSF lifecycle issue. Given this JSP code:

<h:inputText id="boundinput" binding="#{UserBean.boundInput}">

and this Java setter code:

private UIInput boundInput =new UIInput();

publicvoid setBoundInput(UIInput aBoundInput){

this.boundInput = aBoundInput;

String value = aBoundInput.getValue();

}

the result of 'value' is theprevious value of the input text field when the form is submitted. The component is bound, but why isn't the new value available?

It seems to get the 'current' value of the bound component, a valueChangeListener has to be implemented? I may be missing something fundamental, so any help is appreciated.

[1008 byte] By [Java_Marka] at [2007-11-26 15:30:28]
# 1

If you only want to get and set values, use valuebinding instead.

If you're debugging the setBoundInput after form input, then yes, it is correct that the old value is still in there. This would be updated at a later JSF phase yet.

Check http://balusc.xs4all.nl/srv/dev-jep-djl.html to get some insights in the JSF lifecycle.

BalusCa at 2007-7-8 21:47:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Thanks. I actually saw your lifecycle page before posting - very helpful, thanks for putting that up!

What's the basic purpose/usefulness of having bound components, to manage their properties programmatically? The examples I've seen don't do much of anything with them besides having get/set methods.

Java_Marka at 2007-7-8 21:47:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...