Hi Thomas,
OK, thanks. Now it's more clear to me what you're trying to do.
Something like this should work:
<cc:interface>
<cc:attribute name="button1" type="insert.package.here.SimpleModel" />
</cc:interface>
<cc:implementation>
<h:commandButton disabled="#{cc.attrs.button1 == null}"
action="#{cc.attrs.button1.myaction}" value="Button1" />
</cc:implementation>
Regards,
Jakob
2010/11/9 Thomas Möller <[email protected]>:
>
> Hi Jakob,
>
> I wanted to design the following composite component (a panel with two
> buttons):
>
> <my:buttonPanel button1="#{myBean.button1}" button2="#{myBean.button2}" />
>
> where "#{myBean.button1}" and "#{myBean.button2}" are instances of
> SimpleModel. For the button expression should apply: If it evaluates to
> null the button is disabled, if not SimpleModel.myaction() will be executed.
>
> Therefore I wanted to express with the following composite component
> attribute declaration:
>
> <cc:attribute name="button1" type="SimpleModel" >
> <cc:attribute name="myaction" targetAttributeName="action"
> targets="button" />
> </cc:attribute>
>
> that the attribute "myaction" of the instance maps to the action of the
> button. I guess that it does not work even with JSF 2.1 because it is a
> nested attribute declaration.
> --
> View this message in context:
> http://old.nabble.com/composite-components%3A-optional-method-expression-attributes-tp30067392p30168428.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