相关疑难解决方法(0)

动态ui include和commandButton

我有一个页面,动态地包含来自另一个页面的内容(这是通过bean中的方法完成的)

firstPage.xhtml

<ui:include src="#{managedBean.pageView}">
    <ui:param name="method" value="#{managedBean.someAction}"/>
</ui:include>
Run Code Online (Sandbox Code Playgroud)

这会重定向到第二个页面,<ui:composition>其中包含commandButton.

secondPage.xhtml

<ui:composition>
..
..
<p:commandButton actionListener=#{method} value="Submit"/>
</ui:composition>
Run Code Online (Sandbox Code Playgroud)

ManagedBean

public String pageView(){
return "secondPage.xhtml";
}

public void someAction(){
*someAction*
}
Run Code Online (Sandbox Code Playgroud)

secondPage.xhtml中的commandButton不起作用.

任何帮助将不胜感激.

primefaces jsf-2 uiinclude commandbutton

4
推荐指数
1
解决办法
4728
查看次数

标签 统计

commandbutton ×1

jsf-2 ×1

primefaces ×1

uiinclude ×1