Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.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
Jsf rich:panelMenuItem:如何通过导航菜单刷新动态包含内容_Jsf_Dynamic_Include_Richfaces - Fatal编程技术网

Jsf rich:panelMenuItem:如何通过导航菜单刷新动态包含内容

Jsf rich:panelMenuItem:如何通过导航菜单刷新动态包含内容,jsf,dynamic,include,richfaces,Jsf,Dynamic,Include,Richfaces,我已成功实施了此问题中给出的解决方案->。但是,我想使用rich:panelMenu导航。因此,我想使用rich:panelMenuItem,而不是使用h:commandLink。因此,与其使用下面的代码 <h:panelGroup id="menu" layout="block"> <h:form> <f:ajax render=":content"> <ul> &l

我已成功实施了此问题中给出的解决方案->。但是,我想使用rich:panelMenu导航。因此,我想使用rich:panelMenuItem,而不是使用h:commandLink。因此,与其使用下面的代码

<h:panelGroup id="menu" layout="block">
    <h:form>
        <f:ajax render=":content">
            <ul>
                <li><h:commandLink value="include1" action="#{bean.setPage('include1')}" /></li>            
                <li><h:commandLink value="include2" action="#{bean.setPage('include2')}" /></li>            
                <li><h:commandLink value="include3" action="#{bean.setPage('include3')}" /></li>            
            </ul>
        </f:ajax>
    </h:form>
</h:panelGroup>
<h:panelGroup id="content" layout="block">
    <ui:include src="/WEB-INF/includes/#{bean.page}.xhtml" />
</h:panelGroup>

出于某些原因,rich:panelMenuItem的方式不起作用。我可能做错了什么

删除
行。添加重新渲染时,代码将起作用。不相关:您可以使用
rich:panelMenuItem
rendered
属性,并获得相同的结果(不需要管理页面的bean)。谢谢。但我也在rich:panelMenuItem中使用了render,但它仍然不起作用
<h:panelGroup id="menu" layout="block">
<h:form>
    <rich:panelMenu>
        <rich:panelMenuGroup label="Group 1">                       
            <rich:panelMenuItem label="include1" action="#{bean.setPage('include1')}" />
            <rich:panelMenuItem label="include2" action="#{bean.setPage('include2')}" />
            <rich:panelMenuItem label="include3" action="#{bean.setPage('include3')}" />
        </rich:panelMenuGroup>
    </rich:panelMenu>
</h:form>
</h:panelGroup>
<h:panelGroup id="content" layout="block">
        <ui:include src="/WEB-INF/includes/#{bean.page}.xhtml" />
</h:panelGroup>
@ManagedBean
@ViewScoped
public class Bean implements Serializable {

 private String page;

 @PostConstruct
 public void init() {
     page = "include1"; //  Default include.
 }

 // +getter+setter.
 }