[richfaces-issues] [JBoss JIRA] (RF-12571) aj4:status - onerror - more documentation - more attributes ?

Jean ANDRE (JIRA) jira-events at lists.jboss.org
Sat Oct 27 12:26:01 EDT 2012


     [ 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. Could you please, post here and also at the documentation, some clues, details, information, valuable examples, live demos... to help us managing error on ajax request. Thank you very much.

{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 above code, it seems we can catch at least one object - the event but the event does not seem to have any valuable information.

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

Some old versions?, seems to have 3 attributes like req, status, message on event error but with RichFaces 4.2.3 final, what we can have, have as alternative or do ?


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, which is a NPE
{code}
public String doOpenItem(String tabId, Integer itemId) throws InterruptedException {
  Thread.currentThread().join(2000);
  Integer i = null;
  i.doubleValue();
  return "thepage";
}
{code}

The error is trigger from a simple commandLink
{code}
<a4j:commandLink id="openCmd"
                 action="#{listItemController.doOpenItem(tab.id, item.id)}"
                 render="desktopTabs"
                 value="#{msg['common.command.open']}"
                 status="ajaxStatus" />
{code}

{code}
<!--                    -->
<!--    WAITER MESSAGE  -->
<!--                    -->
<rich:popupPanel id="messageWaiter"
      modal="false"
      style="border:1px solid red;"
      autosized="true"
      resizeable="false"
      shadowDepth="3"
      shadowOpacity="1"
      top="250">
      Please wait...
</rich:popupPanel>
{code}

When we see what it is returned as response from our request when the error is triggered.
Under firebug: 
{code}
<?xml version='1.0' encoding='UTF-8'?>
<partial-response><error><error-name>class javax.faces.el.EvaluationException</error-name><error-message><![CDATA[]]></error-message></error></partial-response>
{code}






  was:
The documentation on aj4:status does not explain very well what we should expected as data to be passed or retrieved when error occurred. Could you please, post here and also at the documentation, some clues, details, information, valuable examples, live demos... to help us managing error on ajax request. Thank you very much.

{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 above code, it seems we can catch at least one object - the event but the event does not seem to have any valuable information.

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

Some old versions?, seems to have 3 attributes like req, status, message on event error but with RichFaces 4.2.3 final, what we can have, have as alternative or do ?


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, which is a NPE
{code}
public String doOpenItem(String tabId, Integer itemId) throws InterruptedException {
  Thread.currentThread().join(2000);
  Integer i = null;
  i.doubleValue();
  return "thepage";
}
{code}

The error is trigger from a simple commandLink
{code}
<a4j:commandLink id="openCmd"
                 action="#{listItemController.doOpenItem(tab.id, item.id)}"
                 render="desktopTabs"
                 value="#{msg['common.command.open']}"
                 status="ajaxStatus" />
{code}

{code}
<!--                    -->
<!--    WAITER MESSAGE  -->
<!--                    -->
<rich:popupPanel id="messageWaiter"
      modal="false"
      style="border:1px solid red;"
      autosized="true"
      resizeable="false"
      shadowDepth="3"
      shadowOpacity="1"
      top="250">
      Please wait...
</rich:popupPanel>
{code}









    
> 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. Could you please, post here and also at the documentation, some clues, details, information, valuable examples, live demos... to help us managing error on ajax request. Thank you very much.
> {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 above code, it seems we can catch at least one object - the event but the event does not seem to have any valuable information.
> It is possible to sent us some valuable information when we received the onerror event from ajax call and tell us what we can use as information to be displayed to user.
> Some old versions?, seems to have 3 attributes like req, status, message on event error but with RichFaces 4.2.3 final, what we can have, have as alternative or do ?
> 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, which is a NPE
> {code}
> public String doOpenItem(String tabId, Integer itemId) throws InterruptedException {
>   Thread.currentThread().join(2000);
>   Integer i = null;
>   i.doubleValue();
>   return "thepage";
> }
> {code}
> The error is trigger from a simple commandLink
> {code}
> <a4j:commandLink id="openCmd"
>                  action="#{listItemController.doOpenItem(tab.id, item.id)}"
>                  render="desktopTabs"
>                  value="#{msg['common.command.open']}"
>                  status="ajaxStatus" />
> {code}
> {code}
> <!--                    -->
> <!--    WAITER MESSAGE  -->
> <!--                    -->
> <rich:popupPanel id="messageWaiter"
>       modal="false"
>       style="border:1px solid red;"
>       autosized="true"
>       resizeable="false"
>       shadowDepth="3"
>       shadowOpacity="1"
>       top="250">
>       Please wait...
> </rich:popupPanel>
> {code}
> When we see what it is returned as response from our request when the error is triggered.
> Under firebug: 
> {code}
> <?xml version='1.0' encoding='UTF-8'?>
> <partial-response><error><error-name>class javax.faces.el.EvaluationException</error-name><error-message><![CDATA[]]></error-message></error></partial-response>
> {code}

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


More information about the richfaces-issues mailing list