我有一个带有index.jsp
的JSF/RichFaces设置,其中a4j:include
是包含rich:dataTable
的另一段代码。a4j:包括rich:dataTable对a4j有负面影响:commandButton
它最初呈现的罚款,并选择index.jsp
一个项目的下拉列表,然后点击‘检索’a4j:commandButton
使用支持bean的方法setChosen
做的吩咐在后端。支持bean更新类的成员,然后它的获取者被模型读取元素在一个单独的文件content.jsp
中调用,该文件是a4j:include
d。出现我更新的tabPanel。
我可以在eclipse控制台中看到输出。但是当我再次点击按钮时,没有任何反应。在tomcat 6.0日志中没有任何东西在控制台上。
EDIT1 缩小问题到我content.jsp
文件,而不是上面的index.jsp
代码,我发现一个rich:dataTable
元素的问题。当我从content.jsp
中删除这个元素时,我可以反复点击Retrieve按钮并重新加载我的标签面板。只要我把它放进去,第一次点击就可以了,然后按钮就会点击,但什么也没有发生,按钮也不会退出。
提供rich:dataTable
数据的方法不应该是可疑的,因为它至少第一次工作,但它只执行一些xpath例程并返回ArrayList<MyDataList>
。
鉴于编辑,任何人现在可以建议如何使用rich:dataTable
,以便它不会造成任何麻烦?元素在rich:tabPanel
之内,它位于h:form
之内,但仅此而已。
由于
EDIT2: 响应于下方的评论请求,以下是充分的影响代码列表简短如将重现该问题。 @Damo,请注意a4j:commandButton
和rich:dataTable
在不同的文件中,因为后者在jsp文件中是a4j:include
d。 另请注意,<%@ taglib uri=...
引用已从两个文件中删除。
的index.jsp:
<f:loadBundle basename="messages" var="msg" />
<f:view>
<rich:page pageTitle="MyTitle" 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="Select " />
<h:selectOneMenu id="nodes" value="#{MyBacking.chosen}">
<f:selectItems value="#{MyBacking.nodes}" />
</h:selectOneMenu>
<a4j:commandButton value="Retrieve"
reRender="panel,contentPanel,currNode,lastOp"
onclick="this.disabled=true" oncomplete="this.disabled=false" />
</a4j:outputPanel>
</a4j:form>
</rich:toolBarGroup>
</rich:toolBar>
<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>
a4j:include
d content.jsp
:
<h:form id="myConfig">
<rich:tabPanel switchType="client" rendered="true">
<rich:tab styleClass="tab" label="Connections">
<rich:dataTable onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
cellpadding="0" cellspacing="0" width="100%" border="0" var="item"
value="#{MyBacking.DataList}">
<rich:column style="text-align:center" width="150px">
<h:outputText styleClass="txtBold"
value="#{item.info}:#{item.other}" />
</rich:column>
</rich:dataTable>
</rich:tab>
</rich:tabPanel>
</h:form>
非常感谢确实在看这个。
EDIT3 按照要求,我已经试过封装的h:form
内a4j:include
。为了避免包含的内容嵌套h:表格,我用h:panelGrid
替换了content.jsp
中的封闭h:form
标记。 当我reran这第二次点击a4j:commandButton
仍然造成一个挂起,但我检查与萤火虫和POST http://localhost:8888/index.jsf 200 13ms
发生,但答复是空的。这有帮助吗?
检查Firefox的JavaScript控制台和日志 – Bozho 2010-02-10 15:58:20
发布您的页面,以便我们可以看到commandButton *和*数据表 – Damo 2010-02-11 20:05:35