[ 
https://issues.jboss.org/browse/RF-12571?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jean ANDRE updated RF-12571:
----------------------------

    Description: 
The documentation on aj4:status does not explain very well what we should 
expected as data to be passed or retrieved when error occurred. 


{code}
<a4j:status id="ajax-status"
            name="ajaxStatus"
            onstart="#{rich:component('messageWaiter')}.show()"
            onstop="#{rich:component('messageWaiter')}.hide()"
            onerror="alert(event.type);alert(status);" />
{code}

Based on this code, it seems we can catch at least one object - the event but 
the event doesnot seem to have any valuable information.

It is possible to sent us some valuable information when we received the 
onerror event and tell us what we can use as information to be displayed to 
user when an ajax error occurred.

Some old versions (?), seems to have 3 attributes like req, status, message on 
event error but with RichFaces 4.2.3 final, I catch nothinh


from https://community.jboss.org/message/54813
{code}
A4J.AJAX.onError = function(req, status, message){
 if(status == 505 || status == 500 || status == 400){
 window.alert("Error: "+message + "\n Please contact administrator" );
 }
 }
{code}

For example, in this situation, I emulated an error into the controller.


public String doOpenItem(String tabId, Integer itemId) throws 
InterruptedException {
  Thread.currentThread().join(2000);
  Integer i = null;
  i.doubleValue();
  return "thepage";
}










    
> aj4:status - onerror - more documentation - more attributes ?
> -------------------------------------------------------------
>
>                 Key: RF-12571
>                 URL: https://issues.jboss.org/browse/RF-12571
>             Project: RichFaces
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>            Reporter: Jean ANDRE
>
> The documentation on aj4:status does not explain very well what we should 
> expected as data to be passed or retrieved when error occurred. 
> {code}
> <a4j:status id="ajax-status"
>             name="ajaxStatus"
>             onstart="#{rich:component('messageWaiter')}.show()"
>             onstop="#{rich:component('messageWaiter')}.hide()"
>             onerror="alert(event.type);alert(status);" />
> {code}
> Based on this code, it seems we can catch at least one object - the event but 
> the event doesnot seem to have any valuable information.
> It is possible to sent us some valuable information when we received the 
> onerror event and tell us what we can use as information to be displayed to 
> user when an ajax error occurred.
> Some old versions (?), seems to have 3 attributes like req, status, message 
> on event error but with RichFaces 4.2.3 final, I catch nothinh
> from https://community.jboss.org/message/54813
> {code}
> A4J.AJAX.onError = function(req, status, message){
>  if(status == 505 || status == 500 || status == 400){
>  window.alert("Error: "+message + "\n Please contact administrator" );
>  }
>  }
> {code}
> For example, in this situation, I emulated an error into the controller.
> public String doOpenItem(String tabId, Integer itemId) throws 
> InterruptedException {
>   Thread.currentThread().join(2000);
>   Integer i = null;
>   i.doubleValue();
>   return "thepage";
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
richfaces-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/richfaces-issues

Reply via email to