I need to set the action for a commandLink dynamically.
<ice:repeat value="#{mLeft.links}" var="xxx">
<cvu:leftLink value="#{xxx.value}" action="#{xxx.action}" />
</ice:repeat>
My custom tag:
// old
<ui:composition>
<ice:commandLink immediate="#{immediate}">
<f:attribute name="action" value="#{action}" />
<f:attribute name="actionListener" value="#{actionListener}" />
<f:attribute name="value" value="#{value}" />
</ice:commandLink>
</ui:composition>
But it doesn’t seem to work.
In the past I solved a similar problem using Reflection. Isn’t there a simpler solution ?
I’m using Facelets and JSF 2.0.
EDIT:
Ok. I changed the UI component to JSF 2.0 composite component, but I still can’t manage to make it work. It works only if I call the custom component with a method, and it’s re-targeted to the link in my custom component.
What I want is to be able to generate a list of links each one calling a method I give as String !
about <cc:actionSource I saw that it’s used just for <f:actionListener for="xxx" binding="" />
Please Help.
// new one
<cc:interface>
<cc:attribute name="action" required="true" targets="actiune" />
<cc:attribute name="immediate" required="false" default="false" />
<cc:attribute name="value" required="true" />
<cc:actionSource name="ok" targets="actiune" />
</cc:interface>
<cc:implementation>
<ice:graphicImage value="/images/pucemenu.gif" alt="right"
style="vertical-align: middle; margin-left: 13px;" />
<ice:commandLink id="actiune" immediate="#{cc.attrs.immediate}"
value="#{cc.attrs.value}">
</ice:commandLink>
</cc:implementation>
So there’s no such thing supported yet.