File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Managed Bean as parameter in Composite Component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Managed Bean as parameter in Composite Component" Watch "Managed Bean as parameter in Composite Component" New topic

Managed Bean as parameter in Composite Component

andrew stollen

Joined: Nov 16, 2011
Posts: 1
Is there a way of setting a managed bean parameter in a composite component and then leaving the using classes to decide which actual managed bean to use?

something along the lines of: comp.xhtml

<cc:attribute name="price" />
<cc:param name="pageBean" value="#{superBean}" />
<h:outputText value="#{cc.attrs.price}"/>
And then, in the using page

<ezcomp:comp pageBean="actualBean"
price="#{actualBean.price}" >

In my case ActualBean is a subtype of SuperBean.

I'm not even sure this is possible, but let's just say it would be great if someone proved me wrong.

Thank you in advance
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15958

Welcome to the JavaRanch, Andrew!

I'm not sure I follow this, but as far as I can see, there's no reason why a parameter can't be an entire bean, and not just a property. And, in fact, I think I may even have apps where I exploit that.

So try it and see!

Customer surveys are for companies who didn't pay proper attention to begin with.
Don't get me started about those stupid light bulbs.
subject: Managed Bean as parameter in Composite Component
Similar Threads
set value in a composite component
Add components to a composite component at runtime
composite component not working
cc:insertChildren only works once
ajax within a composite component