代码之家  ›  专栏  ›  技术社区  ›  nkr1pt

使用JSF+RichFaces异步呈现页面块

  •  2
  • nkr1pt  · 技术社区  · 16 年前

    我想使用richfacesa4j支持异步呈现页面上的6个块。

    以下是相关代码:

    <ui:define name="body">
        <h:form id="dashboardform">
         <div class="table_container" style="width:99%">
            <h:panelGrid id="dashboadPanel" columns="3">
    
                <a4j:region id="resourceGraphRegion">
                    <h:panelGroup>
                        <div class="rounded_box dashboard_box">
                            <ui:include src="dashboard_resourceGraph.xhtml"/>
                        </div>
                    </h:panelGroup>
                </a4j:region>
    
                <a4j:region id="profileGraphRegion">
                    <h:panelGroup>
                        <div class="rounded_box dashboard_box" >
                             <ui:include src="dashboad_profileGraph.xhtml"/>
                        </div>
                    </h:panelGroup>
                </a4j:region>
    
                <a4j:region id="reportGraphRegion">
                    <h:panelGroup>
                        <div class="rounded_box dashboard_box" >
                            <ui:include src="dashboard_reportGraph.xhtml"/>
                        </div>
                    </h:panelGroup>
                </a4j:region>
    
                <a4j:region id="installedBaseGraphRegion">
                    <h:panelGroup>
                        <div class="rounded_box dashboard_box" >
                            <ui:include src="dashboard_installedBaseGraph.xhtml"/>
                        </div>
                    </h:panelGroup>
                </a4j:region>
    
                <a4j:region id="simcardGraphRegion">
                    <h:panelGroup>
                        <div class="rounded_box dashboard_box">
                            <ui:include src="dashboard_simcardGraph.xhtml"/>
                        </div>
                    </h:panelGroup>
                </a4j:region>
    
                <a4j:region id="orderOverviewGraphRegion">
                    <h:panelGroup>
                        <div class="rounded_box dashboard_box" id="order">
                            <ui:include src="dashboard_orderOverviewGraph.xhtml"/>
                        </div>
                    </h:panelGroup>
                </a4j:region>
            </h:panelGrid>
    
                <h:panelGrid id="dashboadRefreshPanel" columns="1"  width="100%">
                    <a4j:commandButton value="#{I18n.messages['dashboard.btn.refresh']}" 
                        action="#{dashboardBean.doRefresh}" reRender="resourceGraphRegion, profileGraphRegion, reportGraphRegion, installedBaseGraphRegion, simcardGraphRegion, orderOverviewGraphRegion"
                         image="/static/images/refresh.png" style="border:0px; margin-right: 20px; padding: 0px; float: right;" />
                </h:panelGrid>
        </div> 
    

    但是,当手动触发a4j:commandLink时,整个页面将变为非活动状态(灰显),并显示一个加载图标。

    1 回复  |  直到 16 年前
        1
  •  1
  •   Cid54    16 年前

    要控制加载通知,可以使用

    <a4j:status id="commonstatus"  startText="In progress..." stopText="Complete"/>
    

    tutorial