[英]RichFaces rich:panelMenu stops working when a4j:include'd
From this previously asked question , I have noticed that when I move a rich:panelMenu
(which works fine when in an index.jsp
page) into another.jsp
and then include that in index.jsp
using an a4j:include
tag, the rich:panelMenu
functionality stops working. 从这个以前问的问题 ,我注意到,当我移动一个rich:panelMenu
(这在当正常工作index.jsp
页)到another.jsp
,然后包括在index.jsp
使用a4j:include
标签,将rich:panelMenu
功能停止工作。
Is this a bug? 这是错误吗?
EDIT 1 编辑1
In response to code and after some isolation testing, the problem appears to stem from a coexistence of a rich:dataTable
in another tab of a rich:tabPanel
from the panelMenu. 为了响应代码并经过一些隔离测试,该问题似乎是由于来自panelMenu的rich:tabPanel
另一个选项卡中的rich:tabPanel
rich:dataTable
共存。
If my index.jsp
contains a default simple panelMenu using demo code (inc in the bean) it works as expected: 如果我的index.jsp
包含使用演示代码(Bean中的inc)的默认简单panelMenu,则它将按预期工作:
<f:view>
<rich:page pageTitle="title" markupType="xhtml">
<h:outputText id="setup" value="#{MyBacking.setup}" />
<rich:toolBar height="35" itemSeparator="line">
<rich:toolBarGroup location="left">
<a4j:form>
<a4j:outputPanel id="panel">
<h:outputText style="text-align: center" value="Node Select " />
<h:selectOneMenu id="nodes" value="#{MyBacking.chosenNode}">
<f:selectItems value="#{MyBacking.nodes}" />
</h:selectOneMenu>
<a4j:commandButton value="Retrieve"
reRender="panel,contentPanel"
onclick="this.disabled=true" oncomplete="this.disabled=false" />
</a4j:outputPanel>
</a4j:form>
</rich:toolBarGroup>
</rich:toolBar>
<!-- added start -->
<h:form id="form">
<h:panelGrid columns="2" width="100%">
<rich:panelMenu style="width:200px" mode="ajax"
iconExpandedGroup="disc" iconCollapsedGroup="disc"
iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
iconCollapsedTopGroup="chevronDown">
<rich:panelMenuGroup label="Group 1">
<rich:panelMenuItem label="Item 1.1"
action="#{PanelMenu.updateCurrent}">
<f:param name="current" value="Item 1.1" />
</rich:panelMenuItem>
</rich:panelMenuGroup>
</rich:panelMenu>
<rich:panel bodyClass="rich-laguna-panel-no-header">
<a4j:outputPanel ajaxRendered="true">
<h:outputText value="||#{PanelMenu.current}|| selected"
id="current" />
</a4j:outputPanel>
</rich:panel>
</h:panelGrid>
</h:form>
<!-- added end -->
<rich:panel>
<h:panelGroup layout="block" id="contentPanel">
<a4j:include viewId="#{MyBacking.viewId}">
<f:param name="targetIdParam" value="content" />
</a4j:include>
</h:panelGroup>
</rich:panel>
</rich:page>
</f:view>
But if I remove the added panelMenu
from this file and paste it into a separate tab in a tabPanel
in an external jsp page which is then a4j:include
d in the above index.jsp
, when it's loaded, the panelMenu
refuses to work (outputting nothing to the log or console) while in the other tab in my tab set there is a rich:dataTable
. 但是,如果我从该文件中删除添加的panelMenu
并将其粘贴到外部jsp页面的tabPanel
中的单独选项卡中,则在上面的index.jsp
是a4j:include
d,在加载时, panelMenu
拒绝工作(输出在日志或控制台中没有显示任何内容),而在我的标签集的另一个标签中,有一个rich:dataTable
。 With the exact same code, but with the dataTable
removed from the second tab, it all starts working again. 使用完全相同的代码,但是从第二个选项卡中删除了dataTable
,它们又重新开始工作。
Here's the broken a4j:include
d file with panelMenu
: 这是带有panelMenu
的破碎的a4j:include
d文件:
<h:panelGrid columns="1" border="0" style="width: 100%">
<rich:tabPanel switchType="client" rendered="true">
<rich:tab styleClass="tab" label="Node Logs">
<h:panelGrid columns="2" border="0">
<h:graphicImage value="/btn50.png" width="30" height="30"
alt="Logs" />
<h:outputText value="log: #{MyBacking.chosenNode}"
styleClass="pageTitle" />
</h:panelGrid>
<h:form id="form">
<h:panelGrid columns="2" width="100%">
<rich:panelMenu style="width:200px" mode="ajax"
iconExpandedGroup="disc" iconCollapsedGroup="disc"
iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
iconCollapsedTopGroup="chevronDown">
<rich:panelMenuGroup label="Group 1">
<rich:panelMenuItem label="Item 1.1"
action="#{PanelMenu.updateCurrent}">
<f:param name="current" value="Item 1.1" />
</rich:panelMenuItem>
</rich:panelMenuGroup>
</rich:panelMenu>
<rich:panel bodyClass="rich-laguna-panel-no-header">
<a4j:outputPanel ajaxRendered="true">
<h:outputText value="||#{PanelMenu.current}|| selected"
id="current" />
</a4j:outputPanel>
</rich:panel>
</h:panelGrid>
</h:form>
</rich:tab>
<rich:tab styleClass="tab" label="Docs">
<rich:dataTable value="#{MyBacking.MyData}">
<rich:column style="text-align:center" width="150px">
</rich:column>
</rich:dataTable>
</rich:tab>
</rich:tabPanel>
</h:panelGrid>
Thanks 谢谢
This problem went away when I recast the taglib declarations as 当我将taglib声明重铸为时,此问题消失了
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
instead of using <% %>
tags (which aren't used with facelets anyway) 而不是使用<% %>
标签(无论如何它们都不会与facelets一起使用)
and installed jsf-facelets-1.1.14.jar
. 并安装了jsf-facelets-1.1.14.jar
。 No facelets jar was installed at all until this point! 到目前为止,根本没有安装任何facelets jar!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.