Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF bean methods

 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I have a bean with two methods (in question), on My front JSF page I can click 2 buttons,

Each calls a different method in the same bean, the bean is off session scope.

The second button manipulates some varibles, which should be refelected in JSF, however the second bean in my code seems to be 'unresponsive'.

Where could the problem be??

Is my approach correct, or should each button have a different backing bean?

Regards
Zein
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18094
48
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the method signature. It should be:

public String newGame() {
....
}

If it doesn't match, nothing happens.
 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I've had a look at the method signiture, it is as stated

Both the methods (procees and newGame - as stated in the first post) are in the same bean, and both return strings.

Could it be the faces-config.xml? Does anyone else do use this method, i.e. one JSF page refers to two or more methods in the same bean???

Thanks for your thoughts
Zein
 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Might I add to the above that both the buttons, are in the same form, calling mthods in the same bean, the first button works, the second button dooesnt work, ive checkd the method signitures and they are correct.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic