1-As I know that valueChangeListener was fired in the Process Validations phase before Update Model
Values phase is this true?
My problem is that the managed beans were updated before the valueCahngeListener was fired.
So I want to update the model after the valueChangeListener was fired.How do this?
2-When I call managed bean from another,it got nullPointerException although I declare ir in face-config.xml as follows:
and in the backing bean class:
What I can do to solve this?Has it something missing?
3-How to change the values of HtmlSelectoneMenu programmaticaly?
In the normal order of operations, you should not be manually updating the Model. The JSF Controllers do that automatically at Update Model time. In particular, valueChangeListeners shouldn't be used to update the Model in place of the normal update mechanisms.
ValueChangeListeners also shouldn't contain business logic. Put that in the Action method, instead. At the time the action method is invoked, the Model will be stable with all updates applied.
I can't tell why you seem to have a problem with the Managed Property. However, technically speaking a bean doesn't "call" a bean, and in particular, the proper terminology here is that "tripBean" is injected into the target bean.
A very common mistake that JSF newbies make is that they want their JSF code to "do" things and to "get" stuff to do it with. JSF is architected around the concept of Inversion of Control (IoC), where you don't go after good things, the good things come to you without being asked for. If you're not familiar with IoC and how it interacts with POJOs, I recommend studying it. Things will make a lot more sense.
An IDE is no substitute for an Intelligent Developer.
Joined: Aug 24, 2012
Thanks for your reply .
Would you please send me a topic which explain
how to inject a managed bean as properties ,and the rules of its scopes.