myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Walter Mourão <walter.mou...@gmail.com>
Subject Re: Facelets custom component with an action as a variable like <ui:param
Date Mon, 12 Apr 2010 12:59:08 GMT
Hi, Georg,

yes, there are some (quite ugly) solutions:
http://www.ibm.com/developerworks/java/library/j-facelets2.html

Component with the same problem/solution:
http://code.google.com/p/trinidadcomponents

Cheers,

Walter Mourão
http://waltermourao.com.br
http://arcadian.com.br
http://oriens.com.br



On Mon, Apr 12, 2010 at 8:56 AM, Georg Füchsle <giofyxle@googlemail.com>wrote:

> Hallo,
>
> I use JSF 1.2 with Facelets and Tomahawk.
>
> Now I would like to make a facelets custom component for a navigation
> / toolkit bar (button panel) that looks the same in every page. This
> component should exist of a number of <t:commandButtons that can be
> defined by calling this custom component.
>
> I thougt about something like this:
>
> In a file 'btnPanel.xhtml':
> <span xmlns="http://www.w3.org/1999/xhtml"
>          xmlns:f="http://java.sun.com/jsf/core"
>          xmlns:h="http://java.sun.com/jsf/html"
>          xmlns:ui="http://java.sun.com/jsf/facelets"
>          xmlns:t="http://myfaces.apache.org/tomahawk"
>          xmlns:c="http://java.sun.com/jstl/core">
>
>        <ui:composition>
>        <ui:param name="btn1Value" value="#{btn1Value}"/>
>        <ui:param name="btn1Action" value="#{btn1Action}"/>
>
> .....
>
> </span>
>
>
> I would define this as a custom tag:
>
>        <tag>
>                <tag-name>btnPanel</tag-name>
>                <source>../pages/btnPanel.xhtml</source>
>        </tag>
>
>
> Finally I want to call this control in my xhtml-pages like this:
>
> <safir:btnPanel btn1Value="save" btn1Action="#{mbBean.save}"/>
>
> But I realised that it is not possible to define a variable action for
> my custom control like this. Actually this way JSF looks for a method
> mbBean.getSave() instead of performing the action mbBean.save()
>
>
> Is there another way to do that?
>
> Thanks in advance
>
>
> Georg
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message