Tuesday, 15 April 2014

primefaces - Command Button inside composition page in JSF -



primefaces - Command Button inside composition page in JSF -

i have same problem user1598186 has stated in question here : p:commandbutton doesn't phone call bean's method in <ui:include> page

however, no solution has been given (he has removed <ui:include> tags altogether , used variables instead)

are there ways of using <ui:include> , still have backing bean's method executed, when i'm calling within commandbutton.

any help much appreciated.

el 2.2 method parameters (so, #{bean.method()} instead of #{bean.method}) can used pass method signature can used in actionlistener attribute of commandbutton. next illustration of passing managedbean property passing method signature:

main page

<ui:include src="/jointeam.xhtml"> <ui:param name="propertyvalue" value="#{managedbean.property1} /> <ui:param name="method" value="#{managedbean.performaction()}" /> </ui:include>

jointeam.xhtml

... <h:inputtext value="#{propertyvalue}" /> ... <p:commandbutton value="submit" actionlistener="#{method}" />

you can see how powerful in terms of code reuse , many instances less verbose , easier utilize composite components.

jsf primefaces uiinclude

No comments:

Post a Comment