Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用ajax在jsf primefaces面板中显示managedbean返回的页面 带素数面的jsf_Ajax_Jsf 2_Primefaces - Fatal编程技术网

如何使用ajax在jsf primefaces面板中显示managedbean返回的页面 带素数面的jsf

如何使用ajax在jsf primefaces面板中显示managedbean返回的页面 带素数面的jsf,ajax,jsf-2,primefaces,Ajax,Jsf 2,Primefaces,我试图将页面作为从托管bean返回的字符串获取,该字符串在faces-config.xml中按照导航规则进行配置,现在在jsf primefaces index.xhtml页面中,我使用ajax调用在特定面板中呈现输出页面,但没有在面板中获取页面,而只是导航..那么如何解决这个问题呢?请帮助 提前感谢。 <h:form> <p:commandButton action="#{bean.setPage('page1')}" process="@this"

我试图将页面作为从托管bean返回的字符串获取,该字符串在faces-config.xml中按照导航规则进行配置,现在在jsf primefaces index.xhtml页面中,我使用ajax调用在特定面板中呈现输出页面,但没有在面板中获取页面,而只是导航..那么如何解决这个问题呢?请帮助

提前感谢。


<h:form>
    <p:commandButton action="#{bean.setPage('page1')}" process="@this" 
        update="panel" value="show page 1"/>

    <p:commandButton action="#{bean.setPage('page2')}" process="@this" 
        update="panel" value="show page 2"/>

    <p:panel id="panel" header="dynamic page include">
        <h:panelGroup rendered="#{!empty bean.page}">
            <ui:include src="/WEB-INF/fragments/#{bean.page}.xhtml"/>
        </h:panelGroup>
    </p:panel>
</h:form>