we have a (in our oppinion) very simple scenario here. But we got stuck somehow on composite components and f:attribute tags. I'll try to keep the code as simple as possible.
Composite Component:
<cc:interface name="button">
...
<cc:attribute
name="actionListener"
required="true"
method-signature="void f(javax.faces.event.ActionEvent)"
target="button"
shortDescription="The action listener for this button." />
...
</cc:interface>
<cc:implementation>
<ice:commandButton
...
actionListener="#{cc.attrs.actionListener}"
...>
<cc:insertChildren />
</ice:commandButton>
</cc:implementation>
... now we use the component like this:
<ctrl:button
...
actionListener="#{bean.method}"
...>
<f:attribute name="objectId" value="#{someObject.id}" />
</ctrl:button>
Now we need to access the "objectId" attribute inside the action listener method. We already tried somethign like this:
public void method(ActionEvent event)
{
...
event.getComponent().getAttributes().get("objectId");
...
}
But the attribute map doesn't contain the objectId. Is there anything wrong on this approach? What is the recommended way to solve this problem?
Would be nice if someone could help us out.
Thanks! SlimShady