Error handling - Struts2 JQGrid

276 views
Skip to first unread message

Vijay Dharap

unread,
Jun 26, 2011, 12:51:00 PM6/26/11
to struts2...@googlegroups.com
Hi,

Whenever I get an exception from java backend for the call to display the grid, the error is not getting rendered on screen anywhere.
I tried with
  1. returning ERROR from action.
  2. throwing an exception in action
  3. "errorText" and "errorElementId" attributes of <sjg;grid> tag
  4. subscribing to an error topic via onErrorTopics="some_grid_error"
I verified that I am throwing 500 error back to user via firebug.
I tried to look around.. but..
a. No unit tests are present for the jqgrid related project in struts2-jquery plugin.
b. The grid demo also covers the "good" cases not the "error" cases.

Can anyone help?

Here is my grid block..

<sjg:grid
                id="gridtable"
                formIds="searchVtaForm"
                dataType="json"
                href="%{remoteurl}"
                reloadTopics="reloadGridTable"
                caption="New Launch Issues"
                pager="true"
                gridModel="gridForSearchVta"
                rowList="10,15,20"
                rowNum="15"
                rownumbers="true"
                width="1154"
                altRows="true"
                viewrecords="true"
                errorElementId="incident_grid_errors"
                onErrorTopics="gridError"
                errorText="Some error has happened :-("
                >
            <sjg:gridColumn ..../>
            <sjg:gridColumn ..../>
            <sjg:gridColumn ..../>
            </sjg:grid>

    $.subscribe('gridError', function(event, data) {
        alert('GRid load error : ' + event.originalEvent.id); });

jogep

unread,
Jun 27, 2011, 5:53:27 AM6/27/11
to struts2-jquery
The onErrorTopics should be published when an error on grid load
happens.
Do you have any JavaScript Error Message?


Johannes
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep



On Jun 26, 6:51 pm, Vijay Dharap <dhara...@gmail.com> wrote:
> Hi,
>
> Whenever I get an exception from java backend for the call to display the
> grid, the error is not getting rendered on screen anywhere.
> I tried with
>
>    1. returning ERROR from action.
>    2. throwing an exception in action
>    3. "errorText" and "errorElementId" attributes of <sjg;grid> tag
>    4. subscribing to an error topic via onErrorTopics="some_grid_error"
Reply all
Reply to author
Forward
0 new messages