Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试包含一个组件(带有ui:include)并为调用者页面设置导航规则。包含的组件有一个表单;提交后,我想显示反馈消息(如咆哮)并有条件地再次显示包含的面板。
ui:include
实现这一目标的最佳方法是什么?
您可以使用<ui:param>让调用者为<ui:include>.
<ui:param>
<ui:include>
<ui:include ...> <ui:param name="foo" value="..." /> </ui:include>
您可以将它们传递给<h:commandButton>包含页面中的方法。
<h:commandButton>
<h:commandButton ... action="#{bean.submit(foo)}" />
public String submit(String foo) { // ... }