This content has been marked as final.
Show 2 replies
-
1. a4j:poll redirect redux
ilya40umov Jan 21, 2011 1:32 AM (in response to robertgary1)Take a look at this link:
http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/ArchitectureOverview.html
It says:
RichFaces allows to redefine standard handlers responsible for processing of different exceptional situations. It helps to define own JavaScript, which is executed when these situations occur.
Add the following code to web.xml:
<context-param>
<param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name>
<param-value>true</param-value>
</context-param>
A4J.AJAX.onError = function(req, status, message){
window.alert("Custom onError handler "+message);
}The function defined this way accepts as parameters:
req
- a params string of a request that calls an errorstatus
- the number of an error returned by the servermessage
- a default message for the given error
A4J.AJAX.onExpired = function(loc, expiredMsg){
if(window.confirm("Custom onExpired handler "+expiredMsg+" for a location: "+loc)){
return loc;
} else {
return false;
}
}Here the function receives in params:
loc
- URL of the current page (on demand can be updated)expiredMsg
- a default message on "Session Expiration" event.
Note:
...
<context-param>
<param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
<param-value>false</param-value>
</context-param>
... -
2. a4j:poll redirect redux
robertgary1 Jan 21, 2011 12:25 PM (in response to ilya40umov)Thank you!!!!
I was already using A4J.AJAX.on* functions but did not have the web.xml setting for org.ajax4jsf.handleViewExpiredOnClient. After putting that in it seems to be working.
-Robert