hungsama / struts2-jquery

Automatically exported from code.google.com/p/struts2-jquery
0 stars 0 forks source link

Maximum call stack size exceeded with grid reload #958

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi ,

I am trying to reload the grid on submit of button. but im getting the error as 
Maximum call stack size exceeded in chrome.

Below is my jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
           <%@taglib prefix="s" uri="/struts-tags" %>
    <%@taglib prefix="sj" uri="/struts-jquery-tags" %>
    <%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<title>Insert title here</title>
<sj:head jqueryui="true" jquerytheme="ui-darkness" loadAtOnce="true"/>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
</head>
<style>
.zebra{
background:lightgray;
}

.ui-widget-header{

background: lightblue;
}
</style>
<script>
$(function(){
$.subscribe('handleJsonResult', function(event,data) {
  $('#result').html("<ul id='languagesList'></ul>");
  var list = $('#languagesList');

    $.each(event.originalEvent.data.gridModel, function(index, value) {
         $.each(value, function(key, value1){
                console.log(key + ": " + value1);
                list.append('<li>'+value1+'</li>\n');
            });

    });
$.subscribe('reloadGrid',function(event,data){
//alert('sss');
    });

 //var obj= jQuery.parseJSON(event.originalEvent.data);
  // var list = $('#result');
  // list.html("<ul id='languagesList'></ul>");
  // $.each(obj, function(index, value) {
  //   list.append('<li>'+value.text+' '+vale.key+'</li>\n');
 //  });
    //$.publish("handleJsonResult");
});
});
     datePick=function(element) { 
     $(element).datepicker(
       {
        dateFormat: 'dd-M-yy',
        buttonImage: "calendar.gif",
        buttonImageOnly: true
       }
       );
     };

        function formatLink(cellvalue, options, rowObject) {
                return "<a href='#' onClick='javascript:openDialog("+cellvalue+")'>" + cellvalue + "</a>";
        }
        function openDialog(employee) {
               $("#employees_details").load('success1.jsp');
                $("#employees_details").dialog('open');
        }

</script>
<body>
<h3>Application Users</h3>
<s:actionerror/>
<s:actionmessage/>
<s:url id="remoteurl" action="/getData.action"/>
<s:url var="remoteurl1" action="/getData.action"/>
<s:url var="editurl" action="/edit-grid-entry.action"/>
    <s:url id="remoteurl2" action="jsonsample"/> 
    <sjg:grid
        id="gridtable" 
        caption="Application Users" 
        href="%{remoteurl}" 
        pager="true" 
        gridModel="gridModel" 
        rowList="3,15,20" 
        rowNum="15" 
        rownumbers="true" 
        resizable="true" 
        viewrecords="true" 
        name="gridModel"
        editurl="%{editurl}"
        altRows="true"
        altClass="zebra"
        navigator="true"
        navigatorSearchOptions="{sopt:['eq','ne','lt','gt']}"
        navigatorAddOptions="{height:280,reloadAfterSubmit:true}"
        navigatorEditOptions="{height:280,reloadAfterSubmit:false}"
        navigatorEdit="true"
        navigatorView="false"
        navigatorDelete="true"
        navigatorDeleteOptions="{height:280,reloadAfterSubmit:true}"
        onSuccessTopics="handleJsonResult"
        reloadTopics="reloadGrid"
        loadonce="false"

    >
        <sjg:gridColumn name="id" index="id" title="Id"  formatter="formatLink" sortable="false" search="true"
        searchoptions="{sopt:['eq','ne']}" />
        <sjg:gridColumn name="userName" index="userName" title="User Name" sortable="true" editable="true"/>
        <sjg:gridColumn name="doj" index="doj" title="Date of Joining" sortable="false" editable="true"  formatter="String" editable="true" editoptions="{size: 12, maxlength: 10, dataInit:datePick,attr:{title:'Select the date'} }"/>
        <sjg:gridColumn name="email" index="email" title="EMail" sortable="false" editable="true"/>
    </sjg:grid>
    <div id="result" class="result ui-widget-content ui-corner-all">Click on the link bellow.</div>

    <sj:a id="ajaxjsonlink"
        href="%{remoteurl1}"
        dataType="json"
        onSuccessTopics="handleJsonResult"
        indicator="indicator"
        button="true"
        buttonIcon="ui-icon-gear"
    >
        Run AJAX Action with JSON Rsult
    </sj:a>

     <s:form id="form" action="getData">

    <div>

    <table>

    <tr>

    <td>

    Username

    </td>

    <td>

    <sj:textfield name="userName"></sj:textfield>

    </td>

    </tr>

    <tr>

    <td>

    Id
    </td>

    <td>

    <sj:textfield name="id"></sj:textfield>
        </td>

    </tr>

    </table>

    <div>

    <sj:a onClickTopics="reloadGrid" button="true">Search</sj:a>

    </div>

    </div>

    </s:form>
    <sj:dialog id="employees_details"   title="Employee Details"  autoOpen="false"   modal="true"  width="400"></sj:dialog>
<input type="hidden" value="<s:property value="email"/> ">   
</body>
</html>

Which struts2-jquery plugin version?

Please provide any additional information below.

Original issue reported on code.google.com by bindupri...@gmail.com on 11 Mar 2013 at 11:57

GoogleCodeExporter commented 9 years ago
A Java Stacktrace Exception? Sometimes you need to exclude some properties from 
your JSON Parser.

Original comment by johgep on 7 Apr 2013 at 10:39