I’m stuck on simple JSF2 question:
XHTML:
<xvf:simpleOut identifier="12345"/>
Composite component is supposed to pass “12345” to backing bean and do some output:
<composite:interface>
<composite:attribute name="identifier" required="true" type="java.lang.String"/>
</composite:interface>
<composite:implementation>
<!--@elvariable id="arg" type="java.lang.String"-->
<ui:param name="arg" value="#{cc.attrs.identifier}"/>
<h:outputText value="#{myBean.getTestOutput('???????')}"/>
</composite:implementation>
How do I pass identifier value, ‘12345’ in my case, to bean’s getTestOutput(String arg) method?
You don’t need the
<ui:param>tag at all. This should work:But it might a a good idea to pass
myBeanthrough the interface as well rather than refering to it directly, since it would make the composite component reusable.