I use primefaces with facelets and i have a quastion:
for example i have dataGrid and i want to call method of bean, that registered in faces-config, to include some dynamic content:
<p:dataGrid var="provider" value="#{paymentFormBean.providers}">
<ui:include src="contentFactory.getSpecificForm('some attribute')"/>
</p:dataGrid>
How could i invoke getSpecificForm method with argument from var of dataGrid? Something like:
<p:dataGrid var="provider" value="#{paymentFormBean.providers}">
<ui:include src="contentFactory.getSpecificForm(provider.formName)"/>
</p:dataGrid>
UPDATE: if i try to invoke method in actionListener of any component in dataGrid:
<p:commandLink update="details" actionListener="#{contentFactory.getSpecificForm(provider.formName)}" />
then attribute is passed corretly, but in ui:include the value is empty
Could anyone help me?
Thank you
Just make
ContentFactorya managed beanso that you can use EL to invoke it
Update: I forgot,
ui:includeinside an UI repeater doesn’t work. Consider usingc:forEachinstead ofp:dataGrid. You’ll only have to apply/nest the desired components and/or HTML/CSS yourself inside thec:forEach.