How do I set Managed Bean field to the value of a ui:param?

拥有回忆 提交于 2019-12-20 03:43:29

问题


I have a JSF page that is included in other JSF pages (basically a page header, with common information). This common page has its own controller and is reliant that the page which includes this common page pass it some common data.

Specifically, I am currently trying to include this common page on other pages using:

<ui:include src="commonPage.xhtml">
   <ui:param name="commonData" value="#{thisPagesController.commonData}"/>
</ui:include>   

Which should pass "commonData" to the commonPage.xhtml page and ideally set the "commonData" property on the CommonPageController class:

@ManagedProperty("#{commonData}")
CommonData commonData;

However, this is not working... the managed property is not getting set.

What is the proper way to do this?


回答1:


See comment from BalusC. There is no standard for this in the JSF API spec. Use a composite or custom component instead.



来源:https://stackoverflow.com/questions/10982987/how-do-i-set-managed-bean-field-to-the-value-of-a-uiparam

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!