myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <craig...@gmail.com>
Subject Re: How do I get a facet's body as string
Date Fri, 06 May 2005 18:00:37 GMT
On 5/6/05, Sylvain Vieujot <svieujot@apache.org> wrote:
>  I'm trying to refactor the aliasBean to use facets to add aliases, instead
> of having to insert aliasBean tags one in another.
>  
>  So, it would look like :
>  
>  <x:aliasBean>
>      <f:facet name="aliasName1">#{expression1}</f:facet>
>      <f:facet name="aliasName2">#{expression2}</f:facet>
>      <f:facet name="aliasName3">constantString</f:facet>
>  

The only legal content for a facet is a single component ... so you
could do something like this:

    <x:aliasBean>
        <f:facet name="aliasName1">
            <h:outputText value="#{expression1}"/>
        </f:facet>
    </x:aliasBean>

and then, if you had a reference to an aliasBean instance, you could say:

    UIOutput output = (UIOutput) aliasBean.getFacet("aliasName1");
    String value = (String) output.getValue();

Craig

Mime
View raw message