Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

managed bean in JSF.

 
samarthya saurabh
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have defined a message bean in the JSF example I use to simply store the Login name and password values to be displayed on the navigated next page. My problem is even though there is no complication error. Only NULL gets set and returned. I have tried to debug and check if the setfunction is called, and it does but with null values and not with the actual text box values.

See below - faces-config.xml


and the login page looks like


and the navigated page is simply


I know I am wrong somewhere, but just seem to oblivious to it. Any help?
 
eve agostini
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to put the inputText components and the command button in the same form, otherwise the variables in the bean won't be set.
(as an alternative you may use a value change listener)
 
samarthya saurabh
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic