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
Jsf 2 它不工作';ActionExpression';在动态菜单中。素面_Jsf 2_Primefaces - Fatal编程技术网

Jsf 2 它不工作';ActionExpression';在动态菜单中。素面

Jsf 2 它不工作';ActionExpression';在动态菜单中。素面,jsf-2,primefaces,Jsf 2,Primefaces,我的代码如下: <h:form> <p:accordionPanel> <p:tab title="TAB 1"> <h:panelGrid columns="2" cellpadding="10"> <p:menu model="#{usuarioSesion.miMenu}" /> </h:panelGrid> </p:tab> <p:tab t

我的代码如下:

<h:form>

<p:accordionPanel>
    <p:tab title="TAB 1">
    <h:panelGrid columns="2" cellpadding="10">
        <p:menu model="#{usuarioSesion.miMenu}" />
    </h:panelGrid>
    </p:tab>
    <p:tab title="TAB 2">
    <h:panelGrid columns="2" cellpadding="10">
            Ayuda
    </h:panelGrid>
    </p:tab>            
</p:accordionPanel>

</h:form>
当我单击菜单项运行此代码时,永远不会执行方法listar1(),listar2()

原因是什么

但是,对于此代码:

<h:form>
      <h:panelGrid columns="2" cellpadding="10">
         <p:menu model="#{usuarioSesion.miMenu}" />
   </h:panelGrid>
</h:form>

菜单很好用。为什么


谢谢解决方法:我发现添加:

<h:panelGrid columns="2" cellpadding="10" style="display:none">
    <p:menu model="#{usuarioSesion.miMenu}" />
</h:panelGrid>

到您的表单,解决问题。最终形式的内容将是:

<h:form>
<p:accordionPanel>
    <p:tab title="TAB 1">
    <h:panelGrid columns="2" cellpadding="10">
        <p:menu model="#{usuarioSesion.miMenu}" />
    </h:panelGrid>
    </p:tab>
    <p:tab title="TAB 2">
    <h:panelGrid columns="2" cellpadding="10">
            Ayuda
    </h:panelGrid>
    </p:tab>            
</p:accordionPanel>
<h:panelGrid columns="2" cellpadding="10" style="display:none">
    <p:menu model="#{usuarioSesion.miMenu}" />
</h:panelGrid>
</h:form>

阿尤达

请添加您的PF和JSF版本。
<h:form>
<p:accordionPanel>
    <p:tab title="TAB 1">
    <h:panelGrid columns="2" cellpadding="10">
        <p:menu model="#{usuarioSesion.miMenu}" />
    </h:panelGrid>
    </p:tab>
    <p:tab title="TAB 2">
    <h:panelGrid columns="2" cellpadding="10">
            Ayuda
    </h:panelGrid>
    </p:tab>            
</p:accordionPanel>
<h:panelGrid columns="2" cellpadding="10" style="display:none">
    <p:menu model="#{usuarioSesion.miMenu}" />
</h:panelGrid>
</h:form>