• 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

More than one bean a page

 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mark,

I'll look into the faces-config file.
 
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
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic