簡體   English   中英

在不使用a4j:status的情況下,為每個ajax請求調用rich:modalPanel?

[英]Call rich:modalPanel for every ajax request with out using a4j:status?

我正在使用JSF richfaces開發Web應用程序。主模板中有一個rich:modalpanel 此模式面板具有“您的請求正在處理.....”消息。

我想在每個動作( ajax request )中顯示此消息( modalPanel )。 但不使用a4j:status元素。

是否有可能做到這一點(使用監聽器或其他方式)?
如何使用偵聽器顯示所有動作的wait modalPanel?

幫我解決這個問題。 提前致謝。

更新:

如果我用我的主要神廟

<a4j:status id="waittingMessage"
            onstart="javascript:Richfaces.showModalPanel('progressWaitModalPanel');"
            onstop="javascript:Richfaces.hideModalPanel('progressWaitModalPanel');"/>       

我將上述a4j:status稱為以下位置:以下每個組件我在我的應用程序中使用了100多個位置

            <a4j:commandButton status="waittingMessage"/> 
            <a4j:commandLink   status="waittingMessage"/> 
<h:selectOneMenu><a4j:support  status="waittingMessage"/>  </h:selectOneMenu>
<h:selectOneRadio><a4j:support status="waittingmessage"/></h:selectOneRadio>
<h:selectBooleanCheckbox><a4j:support status="waittingmessage"/></h:selectBooleanCheckbox>

在未來,

我不需要顯示progressWaitModalPanel ,那時候我將刪除主模板中的a4j:status
但是,此status =“ waittingMessage”呢? 因為此狀態=“ waittingmessage”,所以我在整個應用程序中添加了1000多個位置。

<a4j:status>是執行此操作的正確方法。 我沒有其他辦法了 也許您可以使用一些底層的javascript,但是這樣做是錯誤的。

如果status為當前form ,則無需顯式指出哪個是狀態-默認情況下使用。

<a4j:status id="waittingMessage"
        onstart="Richfaces.showModalPanel('id_modalPanel')"
        onstop="Richfaces.hideModalPanel('id_modalPanel')">
        <f:facet name="start">
            <label></label>
        </f:facet>
        <f:facet name="stop">
            <label></label>
        </f:facet>
</a4j:status>
<ui:include src="/modalPanel.xhtml" />

modalPanel.xhtml可以包含與顯示相關的內容。

您可以將上面的內容放在單獨的文件中,例如status.xhtml,然后將其包含在其他頁面中,如下所示:

<a4j:outputPanel ajaxRendered="true">
<ui:include src="status.xhtml" />
</a4j:outputPanel>

因此,具有ajax請求的任何頁面都將顯示在消息窗口上方。您無需為每個a4j:button等添加任何狀態msg。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM