Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Call back bean method from a facelet template.

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I've looked every where for that, and I just can't find a solution. I have a composition element which I want to include in various facelet pages, every each with a unique backBean but sharing same interface. So is there any way to pass only the backBean instance to this composition element from the client pages. I tried this method:

Composition Element comEl.xhtml


Client page page1.xhtml backBean=page1Bean


Actually disabled="#{bean.getCount()==0}" works ok, if the count is 0 the link gets disabled.
But action="#{bean.sayHello}" doesn't work.

Exception during request processing:
Caused by javax.el.PropertyNotFoundException with message: "Target Unreachable, identifier 'bean' resolved to null"

 
Saloon Keeper
Posts: 24847
174
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
I'm not sure what your problem is, unless there's something funny about the "s:link" element itself. I do this sort of thing extensively and other than my choice of elements in the included text, that's the way I do it.

Although a quick check indicates I'm using "ui:component", not "ui:composition". I can't remember the difference offhand, but I'm fairly sure that one of them limits the context that gets pulled in.
 
Jakim Rachev
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes it seems that the problem is in <s:link>. Just right now i tried with h:commandLink and everything was just fine.
Thanks Tim.
 
reply
    Bookmark Topic Watch Topic
  • New Topic