views:

41

answers:

3

Hi,

I am developing web application using JSF richfaces.I have one rich:modalpanel in main templete. This modalPanel have 'Your request is processing....." message.

I want to show this message(modalPanel) every action(ajax request). But without using a4j:status element.

Is there possible to acheive this(using listener or any otherway)?
How to show the wait modalPanel for all action using listener?

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: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.
But what about this status="waittingMessage"? Because this status="waittingmessage" i added more than 1000 places in my whole application.

+1  A: 

<a4j:status> is the proper way to do this. 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.

If the status is in the current form, there is no need to explicitly indicate which is the status - it is used by default.

Bozho
thanks for your reply. Is possible to use listener for accomplished this process.
EswaraMoorthyNEC
I don't think so. What listeners, you mean?
Bozho
PhaseListener,ActionListener,HttpSessionListener and something
EswaraMoorthyNEC
even if that was possible, it would be ugly. Why exactly you don't want `<a4j:status>` ?
Bozho
Now update my question.
EswaraMoorthyNEC
+1  A: 
<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.

you can put the content above in a separate file say status.xhtml and then include it in your other pages as below:

<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.

daedlus
A: 

I agree with Bozho. It's best to use a4j:status. Some custom JavaScript could be used but really not the best way to go about it.

Max Katz