Tim and others,
I'm at a loss at following valueChangeListener behavior. I could not find this behavior in the documentation. If anyone wants they can use the code below and create simple facelet and managed bean to
test. I'm using
JSF 1.2.
I have a simple JSF page with 2 input componenets.
MBean class has following action methods:
Below are 2 issues I found:
1) valueChangeListener method gets fired during validation phase.
This is an issue since I need to invoke business logic and update bean values in valueChangeListener method.
I want the new values to get rendered on page. However my values gets overwritten in the later phases. Should'nt action/listener methods get invoked in invoke application phase ? How do I update bean values on the server side based on drop down selection and redisplay after post back?
2. valueChangeListener method gets fired although no value was changed
Enter a value in inputText and clicking save fires valueChangeListener and then saveSPConfig action method. However I did NOT change drop down value.
From the logs below I see why this happens, but this is incorrect behavior. User did not select a new value from drop down.
valueChangeListener is a common feature. I'm pretty sure there's a standard
pattern out there to fix above behavior.
Overall I think the JSF model is quite complex. The detailed life cycle phases make the model very robust but at the same time a very big learning curve. What would be nice is to have a good design pattern book for JSF.