• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

3 problems of JSF

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am facing 3 problems in my program:

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?

Please I want help

Thanks and best regards
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
liliane fahmy
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Thank you
 
Greenhorn
Posts: 20
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


You can inject beans using managed property annotation .
 
reply
    Bookmark Topic Watch Topic
  • New Topic