• Post Reply Bookmark Topic Watch Topic
  • New Topic

More than one bean a page  RSS feed

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

I have a small issue, I want to have a page with 2 beans, i.e. a page loads up with a search function, you search waht you need (first bean) and then results have a bean associated with them i.e. accept/reject (second bean).

Each bean operates inside a different form.

The first bean works fine, The problem i'm encountering is that when I click the buttons for the second bean, the original page loads, no fucntionality takes place.

Is what I'm trying to do sound JSF practise?

Thanks for your thoughts.
Zein
 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've left the description a little vague, I should dwell on it more/

Page search.jsp loads with a search function - which is associated with BeanA and FormA.

When you search, the same page is populated with the results - FormB, the user has the option of accepting/rejecting the result - associated with a second bean, BeanB.

My question is this arrangement sound JSF practise?

BeanB doesnt seem to work in this arrangement for me, yet the code works fine on a sepearate page.

Zein
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have more than one bean for a page all the time. Maybe your navigation rule is not firing accurately for the second bean.

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

I'll look into the faces-config file.
 
Tim Holloway
Bartender
Posts: 18662
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Multiple beans is no problem. Having them reside in different forms is no problem either. However, expecting updates from both forms to post at the same time is doomed to failure - when you send a form in HTTP, only the values in the form that's actually being submitted will be sent to the server. You don't post a "page", you post a form.

When in doubt, remember - if it can't work in straight HTTP, it can't work in JSF (or Struts or even PHP). High-level platforms give a lot of power, but they're limited to what the infrastructure will support.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!