You cannot use EL rendering time in id attribute. Give it a fixed identifier and give the composite itself also an identifier. Thus, for example:
<buttons:myButton id="foo" ... />
c in implementation
<h:commandButton id="button1" ... /> <h:commandButton id="button2" ... /> <h:commandButton id="button3" ... />
Then they will become foo:button1 , foo:button2 and foo:button3 , where the part of foo is thus controlled by the template client.
If you really need dynamic identifiers for some non-obvious reason, you'd better create a tag file rather than a composite component.
source share