custom facelets tag: render children

View: New views
4 Messages — Rating Filter:   Alert me  

custom facelets tag: render children

by smilysep :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi i want to implement something like this:

<a:customTable>
  <a:customColumn>
  <a:customColumn>
<a:customTable>

where customTable is a facelets tag with no java code, only a xhtml file which is registered in the facelets taglib. This tag just has to wrapp the body in a common t:datatable with a pager as footer and some styling. It would be very nice for me, because that will avoid a lot of duplicated jsp table code.

some guesses?

thanks

Re: custom facelets tag: render children

by smilysep :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

As Example it should be something like this file "customTable":

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:t="http://myfaces.apache.org/tomahawk">
<ui:composition>
                <t:dataTable id="${listId}" value="${list}" var="link"
                        binding="${listBinding}" columnClasses="class1,class2">

                        <!--HOW TO JUST PLACE TAG BODY CONTENT HERE? -->

                        <f:facet name="footer">
                                        <t:dataScroller for="${listId}" styleClass="cumtableFooter"
                                                fastStep="10" pageCountVar="pageCount" pageIndexVar="pageIndex"
                                                paginator="true" paginatorMaxPages="9"
                                                paginatorActiveColumnStyle="font-weight:bold;">
                                                <f:facet name="first">
                                                        <t:graphicImage url="images/arrow-first.gif" border="1" />
                                                </f:facet>
                                                <f:facet name="last">
                                                        <t:graphicImage url="images/arrow-last.gif" border="1" />
                                                </f:facet>
                                                <f:facet name="previous">
                                                        <t:graphicImage url="images/arrow-previous.gif" border="1" />
                                                </f:facet>
                                                <f:facet name="next">
                                                        <t:graphicImage url="images/arrow-next.gif" border="1" />
                                                </f:facet>
                                                <f:facet name="fastforward">
                                                        <t:graphicImage url="images/arrow-ff.gif" border="1" />
                                                </f:facet>
                                                <f:facet name="fastrewind">
                                                        <t:graphicImage url="images/arrow-fr.gif" border="1" />
                                                </f:facet>
                                        </t:dataScroller>
                        </f:facet>
                </t:dataTable>
</ui:composition>
</html>

Re: custom facelets tag: render children

by Geoff Longo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Did you try <ui:insert/>?  See https://facelets.dev.java.net/nonav/docs/dev/docbook.html#template.

On Sun, Jun 7, 2009 at 6:27 PM, smilysep <seproyal@...> wrote:

As Example it should be something like this file "customTable":

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:t="http://myfaces.apache.org/tomahawk">
<ui:composition>
               <t:dataTable id="${listId}" value="${list}" var="link"
                       binding="${listBinding}" columnClasses="class1,class2">

                       <!--HOW TO JUST PLACE TAG BODY CONTENT HERE? -->

                       <f:facet name="footer">
                                       <t:dataScroller for="${listId}" styleClass="cumtableFooter"
                                               fastStep="10" pageCountVar="pageCount" pageIndexVar="pageIndex"
                                               paginator="true" paginatorMaxPages="9"
                                               paginatorActiveColumnStyle="font-weight:bold;">
                                               <f:facet name="first">
                                                       <t:graphicImage url="images/arrow-first.gif" border="1" />
                                               </f:facet>
                                               <f:facet name="last">
                                                       <t:graphicImage url="images/arrow-last.gif" border="1" />
                                               </f:facet>
                                               <f:facet name="previous">
                                                       <t:graphicImage url="images/arrow-previous.gif" border="1" />
                                               </f:facet>
                                               <f:facet name="next">
                                                       <t:graphicImage url="images/arrow-next.gif" border="1" />
                                               </f:facet>
                                               <f:facet name="fastforward">
                                                       <t:graphicImage url="images/arrow-ff.gif" border="1" />
                                               </f:facet>
                                               <f:facet name="fastrewind">
                                                       <t:graphicImage url="images/arrow-fr.gif" border="1" />
                                               </f:facet>
                                       </t:dataScroller>
                       </f:facet>
               </t:dataTable>
</ui:composition>
</html>

--
View this message in context: http://www.nabble.com/custom-facelets-tag%3A-render-children-tp23915981p23916039.html
Sent from the java.net - facelets users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: custom facelets tag: render children

by smilysep :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Year that perfectly works. Thank you very much.

Here the solution again:

file customTable.xhtml (also got registered in facelets Taglib)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:t="http://myfaces.apache.org/tomahawk">
        <ui:composition>
                <t:outputText value="Wrappint Start"/>
                        <ui:insert/>
                <t:outputText value="Wrappint End"/>
        </ui:composition>
</html>

usage may be:
<a:customTable>
   <t:outputText value="inside table wrapping"/>
</a:customTable>



Geoff Longo wrote:
>
> Did you try <ui:insert/>?  See
> https://facelets.dev.java.net/nonav/docs/dev/docbook.html#template.



Geoff Longo wrote:
Did you try <ui:insert/>?  See
https://facelets.dev.java.net/nonav/docs/dev/docbook.html#template.

On Sun, Jun 7, 2009 at 6:27 PM, smilysep <seproyal@gmx.de> wrote:

>
> As Example it should be something like this file "customTable":
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
>        xmlns:ui="http://java.sun.com/jsf/facelets"
>        xmlns:h="http://java.sun.com/jsf/html"
>        xmlns:f="http://java.sun.com/jsf/core"
>        xmlns:t="http://myfaces.apache.org/tomahawk">
> <ui:composition>
>                <t:dataTable id="${listId}" value="${list}" var="link"
>                        binding="${listBinding}"
> columnClasses="class1,class2">
>
>                        <!--HOW TO JUST PLACE TAG BODY CONTENT HERE? -->
>
>                        <f:facet name="footer">
>                                        <t:dataScroller for="${listId}"
> styleClass="cumtableFooter"
>                                                fastStep="10"
> pageCountVar="pageCount" pageIndexVar="pageIndex"
>                                                paginator="true"
> paginatorMaxPages="9"
>
>  paginatorActiveColumnStyle="font-weight:bold;">
>                                                <f:facet name="first">
>                                                        <t:graphicImage
> url="images/arrow-first.gif" border="1" />
>                                                </f:facet>
>                                                <f:facet name="last">
>                                                        <t:graphicImage
> url="images/arrow-last.gif" border="1" />
>                                                </f:facet>
>                                                <f:facet name="previous">
>                                                        <t:graphicImage
> url="images/arrow-previous.gif" border="1" />
>                                                </f:facet>
>                                                <f:facet name="next">
>                                                        <t:graphicImage
> url="images/arrow-next.gif" border="1" />
>                                                </f:facet>
>                                                <f:facet name="fastforward">
>                                                        <t:graphicImage
> url="images/arrow-ff.gif" border="1" />
>                                                </f:facet>
>                                                <f:facet name="fastrewind">
>                                                        <t:graphicImage
> url="images/arrow-fr.gif" border="1" />
>                                                </f:facet>
>                                        </t:dataScroller>
>                        </f:facet>
>                </t:dataTable>
> </ui:composition>
> </html>
>
> --
> View this message in context:
> http://www.nabble.com/custom-facelets-tag%3A-render-children-tp23915981p23916039.html
> Sent from the java.net - facelets users mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@facelets.dev.java.net
> For additional commands, e-mail: users-help@facelets.dev.java.net
>
>