I was able to read the attribute passed to cc in the next setup.
<test:inner> <f:attribute name="fAttribute" value="myAttributeValue" /> </test:inner>
<cc:implementation> <h:commandButton value="button" actionListener="#{testBean.actionListener}" > <f:attribute name="innerAttribute" value="innerAttributeValue" /> <cc:insertChildren /> </h:commandButton> </cc:implementation>
public void actionListener(ActionEvent event) { event.getComponent().getNamingContainer().getAttributes().get("fAttribute")
The trick was to search in the button names container. Thus, cc is always a named container, you can be sure that you will get into the internal component.
I'm not sure if that was the way it was intentional, but as I understand it, naming smoothing collects such attributes for its children.
Q: Does anyone know if not passing attributes to the button is considered an error in Mojarra / JSF?
source share