简体   繁体   English

在不使用a4j:status的情况下,为每个ajax请求调用rich:modalPanel?

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

I am developing web application using JSF richfaces.I have one rich:modalpanel in main templete. 我正在使用JSF richfaces开发Web应用程序。主模板中有一个rich:modalpanel This modalPanel have 'Your request is processing....." message. 此模式面板具有“您的请求正在处理.....”消息。

I want to show this message( modalPanel ) every action( ajax request ). 我想在每个动作( ajax request )中显示此消息( modalPanel )。 But without using a4j:status element. 但不使用a4j:status元素。

Is there possible to acheive this(using listener or any otherway)? 是否有可能做到这一点(使用监听器或其他方式)?
How to show the wait modalPanel for all action using listener ? 如何使用侦听器显示所有动作的wait modalPanel?

Help me about this. 帮我解决这个问题。 Thanks in advance. 提前致谢。

Update : 更新:

If i use my main templete, 如果我用我的主要神庙

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

And i call the above a4j:status for the following places : The following each and every component i use more than 100 place in my application 我将上述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>

In future, 在未来,

i don't need to show the progressWaitModalPanel , that time i will delete a4j:status in main templete. 我不需要显示progressWaitModalPanel ,那时候我将删除主模板中的a4j:status
But what about this status="waittingMessage" ? 但是,此status =“ waittingMessage”呢? Because this status="waittingmessage" i added more than 1000 places in my whole application. 因为此状态=“ waittingmessage”,所以我在整个应用程序中添加了1000多个位置。

<a4j:status> is the proper way to do this. <a4j:status>是执行此操作的正确方法。 I don't know of any other way. 我没有其他办法了 Perhaps you can hook to some low-level javascript, but that would be the wrong thing to do. 也许您可以使用一些底层的javascript,但是这样做是错误的。

If the status is in the current form , there is no need to explicitly indicate which is the status - it is used by default. 如果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 can contain display related content. modalPanel.xhtml可以包含与显示相关的内容。

you can put the content above in a separate file say status.xhtml and then include it in your other pages as below: 您可以将上面的内容放在单独的文件中,例如status.xhtml,然后将其包含在其他页面中,如下所示:

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

so any page that has ajax request will display above message window You need not add any status msg for each a4j:button ,etc. 因此,具有ajax请求的任何页面都将显示在消息窗口上方。您无需为每个a4j:button等添加任何状态msg。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM