• Post Reply Bookmark Topic Watch Topic
  • New Topic

My Managed Bean don't go to the requestmap.  RSS feed

 
Frederico Benevides
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have my page



So as I'm testing, when I click in the button, after "editing". I don't know why I can't get a requestMap in my bean "userMB". Only shows the "userManagerMB" in the request.

my faces-config.


my classes


Someone has any idea why I can't get the my "userMB" in the request?

Thank you!
 
Ravindra Rawat
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frederico,

Checkout the full request map dump. Do you find any faces bean there?

Beans can be accessed by using a variable resolver (http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/api/index.html) or you can inject the required beans. See http://www.oracle.com/technology/tech/java/newsletter/articles/jsf_pojo/index.html

Thanks
Ravindra
 
Frederico Benevides
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only bean in my request is the userManagerMB.

About injecting my beans in the faces-config, it works normally.
 
Edisandro Bessa
Ranch Hand
Posts: 584
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi "Fred",

I think I have a good clue regarding your problem :

All managed beans take place (are put on request, session or application scopes) only right after its first usage is encountered during JSF page processing.

I could see that your userMB bean is supposed to be valid only if the userManagerMB editable property is false, right ?

So, supposing the userManagerMB editable property is true on the first time the page is loaded, the userMB bean never takes place.

I think you should change your class logic, so just for testing purposes, try to change the value of rendered property of the first outputText component to the following value : rendered="#{userManagerMB.editable}" instead of rendered="#{not userManagerMB.editable}".

And then check whether userMB bean is available for your class.

Please let us know about the results.

B. Rgds.
Edisandro
[ June 05, 2007: Message edited by: Edisandro Bessa ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!