webtier@glassfish.java.net

Re: [webtier] JSF2.0 Composite Component with f:param

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Wed, 07 Jan 2009 18:45:55 -0800

Ryan Lubke wrote:
> Hello,
>
> I'm looking into this now and will get back to you.
Ok, so the current implementation of insertChildren has render-time only
semantics.

This means that at build time, the UIParameter child is added as a child
of the UINamingContainer
placeholder for the composite component reference in the consuming
page. Then at render time,
the children of that composite component are rendered. I think your use
case was overlooked when
designing insertChildren.

That having been said, I've got a fix locally that makes insertChildren
more akin to ui:insert, but I need to:

  A) do some more testing
  B) run the changes by the specification leads.

I'll follow up here as we progress on this issue. Thanks for bringing
it up!
>
> Lincoln Baxter, III wrote:
>> Hi all,
>>
>> I'm attempting to create an EZComp composite:component that takes
>> multiple <f:param value=""/> tags and passes them to a sub-element,
>> but it seems like all children are encased within a UIOutput
>> component, thus f:param tag is not available as a child of the EZComp
>> component itself, and my renderer class is not getting the values it
>> needs.
>>
>> <ocp:link value="#{myBean.getMappingId}">
>> <f:param value="${myBean.name}" /> *<!-- This param never makes it
>> to where it needs to go -->*
>> My Link Text
>> </ocp:link>
>>
>>
>> Is there any way to pass a parameter directly through the component
>> so that the internals receive the parameter? <f:facet> instead of
>> <composite:insertChildren /> does not seem to work either, and would
>> end up cluttering my interface. I just want a straight passthrough
>> like the original <ui:insert /> behaved in facelets. Anything like it?
>>
>> Thanks,
>>
>> Here is my component:
>>
>> <html xmlns="http://www.w3.org/1999/xhtml"
>> xmlns:h="http://java.sun.com/jsf/html"
>> xmlns:f="http://java.sun.com/jsf/core"
>> xmlns:ui="http://java.sun.com/jsf/facelets"
>> xmlns:pretty="http://ocpsoft.com/prettyfaces"
>> xmlns:composite="http://java.sun.com/jsf/composite">
>>
>> <composite:interface>
>> <composite:attribute name="value" required="true" />
>> <composite:attribute name="type" default="mapping" />
>> <composite:attribute name="rendered" default="true" />
>> </composite:interface>
>>
>> <composite:implementation>
>> <f:subview id="linkGroup"
>> rendered="#{compositeComponent.attrs.rendered ne 'false'}">
>> <pretty:link mappingId="#{compositeComponent.attrs.value}"
>> rendered="#{compositeComponent.attrs.type eq 'mapping' || empty
>> compositeComponent.attrs.type}">
>> <composite:insertChildren /> *<!-- This is where the param needs
>> to go -->*
>> </pretty:link>
>> <h:outputLink value="#{compositeComponent.attrs.value}"
>> rendered="#{compositeComponent.attrs.type eq 'url'}">
>> <composite:insertChildren />
>> </h:outputLink>
>> </f:subview>
>> </composite:implementation>
>>
>> </html>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>