• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Invoking bean from included JSF page

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a common toolbar which I want to include on any JSF page when needed. However I need a way to pass my pageBean to toolbar and access properties/methods on the passed pageBean.
The pageBean is in request scope.

Below is the code. I want to include common_toolbar.xhtml into page1.xhtml
common_form.xhtml is where my template is defined and I have not listed, since it is not needed to show my example.

page1.xhtml:


/pages/common_toolbar.xhtml


The page renders fine but when i click on save link I get following error:



On the save, why is JSF framework not creating and setting 'myPage1Bean' in request scope ?





 
Saloon Keeper
Posts: 28494
210
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
 
Naveen Sampra
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How would I reference myPage1Bean that is passed to the include file?
I need to reference both a property(say idValue and action listener(say myListener).

I need to use idvalue on a <h:selectOneListbox ...> component and myListener on a <h:commandLink ...> component.

Appreciate if you can help with correct usage since I'm getting errors when I tried value="#{pageBeanName).idValue" or binding="#{pageBeanName).idValue" etc.
 
Naveen Sampra
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I figured this one out.

 
I've read about this kind of thing at the checkout counter. That's where I met this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic