有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

使用rich:datascroller更改页面后,java actionListener无法在rich:dataTable中工作

在我的java项目中,我使用richfaces 3.3,并尝试使用rich:dataTable组件显示表

<ui:composition template="/main-template.jspx"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:define name="content">

<script type="text/javascript" src="../js/swfobject1_4.js"></script>
<script type="text/javascript" src="#{request.contextPath}/js/slotsHistory.js"></script>
<script type="text/javascript" src="#{request.contextPath}/js/jquery-1.10.2.js"></script>
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/css/slotsHistory.css"/>
<script>
    jQuery.noConflict();
</script>

<f:loadBundle basename="messages" var="msgs"/>
<a4j:form id="gameHistory">
    <h:panelGroup>
        <h2><h:outputText value="#{msgs['game.history.header']}"/></h2>
    </h:panelGroup>

        <h:panelGrid>
            <rich:datascroller id="topScroller"
                               for="gameHistoryTable"
                               maxPages="5"
                               reRender="bottomScroller, gameHistoryTable"
                               rendered="#{casinoGameHistoryController.gameSession.rowsCount > 10}">
                <f:param name="gameSession" value="#{casinoGameHistoryController.gameSession.id}"/>
            </rich:datascroller>
            <rich:dataTable id="gameHistoryTable"
                            var="viewSlotGameHistory"
                            rows="#{casinoGameHistoryController.pageSize}"
                            value="#{casinoGameHistoryController.tableList}"
                            styleClass="tbl" rendered="#{casinoSessionSearchController.showTable}">
                <f:facet name="header">
                    <rich:columnGroup>
                        <rich:column>
                            <h:outputText value="#{msgs['game.history.table.column.flashContent']}"/>
                        </rich:column>
                    </rich:columnGroup>
                </f:facet>

                <rich:column>
                        <a4j:commandButton value="Detailed"
                                       actionListener="#{casinoGameHistoryController.takeSelectionListener}"
                                       oncomplete="#{rich:component('detailedHistoryPopup')}.show()" immediate="true"
                                       reRender="detailedHistoryForm">
                            <f:setPropertyActionListener target="#{casinoGameHistoryController.currentViewGameHistory}" value="#{viewSlotGameHistory}" />
                            <f:param name="gameSession" value="#{casinoGameHistoryController.gameSession.id}"/>
                            <f:attribute name="viewSlotGameHistory" value="#{viewSlotGameHistory}"/>
                        </a4j:commandButton>
                </rich:column>
            </rich:dataTable>

            <rich:datascroller id="bottomScroller"
                               for="gameHistoryTable"
                               maxPages="5"
                               reRender="topScroller, gameHistoryTable"
                               rendered="#{casinoGameHistoryController.gameSession.roundsCount > 10}">
                <f:param name="gameSession" value="#{casinoGameHistoryController.gameSession.id}"/>
            </rich:datascroller>
        </h:panelGrid>

</a4j:form>

<rich:modalPanel id="detailedHistoryPopup" onshow="showDetailed();" onresize="resizeWindow();" width="550" height="550" style="overflow-y:auto;">
        <f:facet name="header">
            <h:outputText value="#{msgs['game.history.detailedHistory']}"/>
        </f:facet>
        <rich:panel>
            <a4j:form id="detailedHistoryForm" ajaxSubmit="true" style="text-align: center;">
                <div id='historyContainer'></div>
                <h:outputText id="json" value="#{casinoGameHistoryController.json}"/>
                   <a4j:commandButton value="#{msgs['game.history.close']}"
                                      oncomplete="#{rich:component('detailedHistoryPopup')}.hide()"/>
            </a4j:form>
        </rich:panel>
</rich:modalPanel>

</ui:define>
</ui:composition>

我的bean有请求范围。下面是代码:

public class CasinoGameHistoryController{

public String getJson(){
    if (currentViewGameHistory == null){
        return null;
    }
    return currentViewGameHistory.getJson();
}

public void setCurrentViewGameHistory(ViewSlotGameHistory currentViewGameHistory) {
    this.currentViewGameHistory = currentViewGameHistory;
}
}

单击表中的“详细”按钮时,将打开包含详细信息的模式窗口

打开第一页时,它可以正常工作。我浏览actionListener,检测当前视图并使用它。 但当我进入第二页(以及其他页面)并单击“详细”按钮时,actionListener不工作,模式窗口为空

我真的不知道怎么会这样

任何解释为什么会发生这种情况都是有用的


共 (0) 个答案