Hi Thomas,

Use the targets attribute of cc:attribute and it should work.

Regards,
Jakob

2010/10/27 Thomas Möller <thomas.moel...@continentale.de>:
>
> Hi,
>
> what is the recommended way how to deal with optional attributes that refer
> to a method expression?
>
> For example imagine a simple component that uses a commandLink and has two
> attributes: "action" and "actionListener":
>
> <cc:interface>
>  <cc:attribute name="action" method-signature="java.lang.String action()"
> default="???" />
>  <cc:attribute name="actionListener" method-signature="void
> actionListener(javax.faces.event.ActionEvent)" default="???" />
> </cc:interface>
>
> <cc:implementation>
>  <tr:commandLink action="#{cc.attrs.action}"
> actionListener="#{cc.attrs.actionListener}" />
> </cc:implementation>
>
> My problems:
> 1) omitting the defaults results in NullPointerExceptions
> 2) the spec says that a default-attribute must evaluate to a
> java.lang.String
>
> What is the solution for this simple problem?
>
> Thanks in advance.
> --
> View this message in context: 
> http://old.nabble.com/composite-components%3A-optional-method-expression-attributes-tp30067392p30067392.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>



-- 
Jakob Korherr

blog: http://www.jakobk.com
twitter: http://twitter.com/jakobkorherr
work: http://www.irian.at

Reply via email to