• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

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: 24560
168
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.

 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic