wood burning stoves 2.0*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Managed Bean as parameter in Composite Component" Watch "Managed Bean as parameter in Composite Component" New topic
Author

Managed Bean as parameter in Composite Component

andrew stollen
Greenhorn

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:interface>
<cc:attribute name="price" />
<cc:param name="pageBean" value="#{superBean}" />
<cc:interface>
<cc:implementation>
<h:outputText value="#{cc.attrs.price}"/>
</cc:implementation>
And then, in the using page

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

</ezcomp:comp>
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: 15639
    
  15

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Managed Bean as parameter in Composite Component
 
Similar Threads
Add components to a composite component at runtime
cc:insertChildren only works once
ajax within a composite component
set value in a composite component
composite component not working