webtier@glassfish.java.net

Re: [webtier] using composition as tag

From: Martin Beránek <martin.beranek_at_i.cz>
Date: Tue, 05 Jan 2010 08:52:14 +0100

On 4.1.2010 19:09, Ryan Lubke wrote:
> On 12/18/09 2:30 AM, Martin Beránek wrote:
>> Hi, in jsf 1.2 I'am using ui:composition for customizing some tags.
>> Advantage of this is that it doesn't include new component to tree and
>> so I can create my own column tag - dataTable search only direct childs.
>>
>> How can I do this in 2.0? Thanks
>>
> I guess I'm confused. 2.0 includes ui:composition and it should work the
> same as Facelets 1.1.x. Is this not the case?

Tnaks for reply. I try to explain it better:

in jsf2 I create components using <composite:*> tags in

$WEBAPP/resources/myname/*

and define namespace as

xmlns:my="http://java.sun.com/jsf/composite/myname

but, this sort of components create new entry in component tree.

I want to create component encapsulating h:column, but with
<composite:*> it doesn't work (obvyously). I copy such composition from
my jsf1 project (stub):

<ui:composition
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core">

        <h:column ...>
                <f:facet name="header">#{title}</f:facet>
                <ui:insert />
        </t:column>

</ui:composition>

but this doesn't work as tag - it throws exception. In jsf1 i have to
register in taglib.xml file, but I guess it's not necessary in jsf2 -
and I want my components have the same prefix.



-- 
Martin Beránek
mailto:martin.beranek_at_i.cz
http://www.i.cz