我有一個帶有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