<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: jqGrid with JSP</title>
	<link>http://www.trirand.com/blog/?page_id=393/jqgrid-roadmap/jqgrid-with-jsp-1</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/jqgrid-roadmap/jqgrid-with-jsp-1/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>empire on jqGrid with JSP</title>
        	<link>http://www.trirand.com/blog/?page_id=393/jqgrid-roadmap/jqgrid-with-jsp-1#p24411</link>
        	<category>jqGrid Roadmap</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/jqgrid-roadmap/jqgrid-with-jsp-1#p24411</guid>
        	        	<description><![CDATA[<p>I was able to resolve this exception(it was because JSON object was not building in proper format). but now I can not display the grid.</p>
<p>I also changed the grid model in java script according to database values now I have no error but everything is blank as we have not given in html where to pring the grid.</p>
</p>
<p>anybody ?</p>
</p>
<p>..</p>
<p>Empire</p>
]]></description>
        	        	<pubDate>Thu, 25 Aug 2011 22:35:46 +0300</pubDate>
        </item>
        <item>
        	<title>empire on jqGrid with JSP</title>
        	<link>http://www.trirand.com/blog/?page_id=393/jqgrid-roadmap/jqgrid-with-jsp-1#p24409</link>
        	<category>jqGrid Roadmap</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/jqgrid-roadmap/jqgrid-with-jsp-1#p24409</guid>
        	        	<description><![CDATA[<p>Hi Nobel I also tried the same example and got the same exception "Error 500: java.lang.NumberFormatException: null".</p>
<p>Did you find the solution for this exception ?</p>
<p>Bryce were you able to run this ?</p>
</p>
<p>Thank you</p>
<p>Empire</p>
]]></description>
        	        	<pubDate>Thu, 25 Aug 2011 21:04:08 +0300</pubDate>
        </item>
        <item>
        	<title>brycekmartin on jqGrid with JSP</title>
        	<link>http://www.trirand.com/blog/?page_id=393/jqgrid-roadmap/jqgrid-with-jsp-1#p22282</link>
        	<category>jqGrid Roadmap</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/jqgrid-roadmap/jqgrid-with-jsp-1#p22282</guid>
        	        	<description><![CDATA[<p>Hey Nobel,</p>
<p>Do you still need help on this??</p>
<p>I have used jqGrid with JSP.&#160; What exactly are the errors you are getting?&#160; Are they JS or Java based?&#160; Are you using Servlets and Beans for data passing?</p>
</p>
<p>Thanks<br />Bryce</p>
]]></description>
        	        	<pubDate>Wed, 02 Mar 2011 18:30:11 +0200</pubDate>
        </item>
        <item>
        	<title>nobel on jqGrid with JSP</title>
        	<link>http://www.trirand.com/blog/?page_id=393/jqgrid-roadmap/jqgrid-with-jsp-1#p21816</link>
        	<category>jqGrid Roadmap</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/jqgrid-roadmap/jqgrid-with-jsp-1#p21816</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>&#160; I have refered the site: <a href="http://trirand.com/blog/jqgrid/jqgrid.html" rel="nofollow" target="_blank"><a href="http://trirand.com/blog/jqgrid" rel="nofollow">http://trirand.com/blog/jqgrid</a>.....qgrid.html</a>. I want to build a Grid for my project officially. Here, They have given sample sources along with the *.php in order to bring db data. I am trying to use *.jsp instead of *.php.&#160;</p>
<p>I have tried to build a jqGrid along with jsp. But, i come across Number Format Exception. I submit my code as follows:</p>
</p>
<p><span style="text-decoration: underline;"><strong>1. index.jsp:</strong></span></p>
<p>&#60;%@ page language="java" contentType="text/html; charset=ISO-8859-1"<br />&#160;&#160;&#160; pageEncoding="ISO-8859-1"%&#62;<br />&#60;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&#62;<br />&#60;html&#62;<br />&#60;head&#62;<br />&#60;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&#62;<br />&#60;title&#62;Sample JQuery Grid&#60;/title&#62;</p>
<p>&#60;!-- In head section we should include the style sheet for the grid --&#62;<br />&#60;link rel="stylesheet" type="text/css" media="screen" href="themes/basic/grid.css" /&#62;</p>
<p>&#60;!-- Of course we should load the jquery library --&#62;<br />&#60;script src="js/jquery-1.4.2.min.js" type="text/javascript"&#62;&#60;/script&#62;</p>
<p>&#60;!-- and at end the jqGrid Java Script file --&#62;<br />&#60;script src="js/jquery.jqGrid.min.js" type="text/javascript"&#62;&#60;/script&#62;</p>
<p>&#60;/head&#62;<br />&#60;body&#62;<br />&#160;&#160; &#160;&#60;table id="list5" class="scroll" cellpadding="0" cellspacing="0"&#62;&#60;/table&#62;<br />&#160;&#160; &#160;&#60;div id="pager5" class="scroll" style="text-align:center;"&#62;&#60;/div&#62;<br />&#160;&#160; &#160;&#60;table id="list5" class="scroll" cellpadding="0" cellspacing="0"&#62;&#60;/table&#62;<br />&#160;&#160; &#160;&#60;div id="pager5" class="scroll" style="text-align:center;"&#62;&#60;/div&#62;<br />&#160;&#160; &#160;&#60;br /&#62;</p>
<p>&#160;&#160; &#160;&#60;a href="#" id="a1"&#62;Get data from selected row&#60;/a&#62;<br />&#160;&#160; &#160;&#60;br /&#62;<br />&#160;&#160; &#160;<br />&#160;&#160; &#160;&#60;a href="#" id="a2"&#62;Delete row 2&#60;/a&#62;<br />&#160;&#160; &#160;&#60;br /&#62;<br />&#160;&#160; &#160;<br />&#160;&#160; &#160;&#60;a href="#" id="a3"&#62;Update amounts in row 1&#60;/a&#62;<br />&#160;&#160; &#160;&#60;br /&#62;<br />&#160;&#160; &#160;<br />&#160;&#160; &#160;&#60;a href="#" id="a4"&#62;Add row with id 99&#60;/a&#62;<br />&#160;&#160; &#160;<br />&#160;&#160; &#160;&#60;script src="manipex.js" type="text/javascript"&#62; &#60;/script&#62;<br />&#160;&#160; &#160;&#60;br /&#62;<br />&#60;/body&#62;<br />&#60;/html&#62;</p>
</p>
<p><span style="text-decoration: underline;"><strong>2. manipex.js:</strong></span></p>
</p>
<p>jQuery("#list5").jqGrid({&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160; &#160;&#160;&#160; &#160;url:&#39;griddata.jsp&#39;,<br />&#160;&#160; &#160;datatype: "json",<br />&#160; &#160;&#160;&#160; &#160;colNames:[&#39;Inv No&#39;,&#39;Date&#39;, &#39;Client&#39;, &#39;Amount&#39;,&#39;Tax&#39;,&#39;Total&#39;,&#39;Notes&#39;],<br />&#160; &#160;&#160;&#160; &#160;colModel:[<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;id&#39;,index:&#39;id&#39;, width:55},<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;invdate&#39;,index:&#39;invdate&#39;, width:90},<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;name&#39;,index:&#39;name&#39;, width:100},<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;amount&#39;,index:&#39;amount&#39;, width:80, align:"right"},<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;tax&#39;,index:&#39;tax&#39;, width:80, align:"right"},&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;total&#39;,index:&#39;total&#39;, width:80,align:"right"},&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;note&#39;,index:&#39;note&#39;, width:150, sortable:false}&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160; &#160;&#160;&#160; &#160;],<br />&#160; &#160;&#160;&#160; &#160;rowNum:10,<br />&#160; &#160;&#160;&#160; &#160;rowList:[4,8,12],<br />&#160; &#160;&#160;&#160; &#160;imgpath: "themes/basic/images",<br />&#160; &#160;&#160;&#160; &#160;pager: jQuery(&#39;#pager5&#39;),<br />&#160; &#160;&#160;&#160; &#160;sortname: &#39;id&#39;,<br />&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160; sortorder: "desc",<br />&#160;&#160;&#160; caption:"Invoice Data"&#160;&#160; &#160;<br />}).navGrid("#pager5",{edit:false,add:false,del:false});</p>
<p>jQuery("#a1").click( function(){<br />&#160;&#160; &#160;var id = jQuery("#list5").getGridParam(&#39;selrow&#39;);<br />&#160;&#160; &#160;if (id)&#160;&#160; &#160;{<br />&#160;&#160; &#160;&#160;&#160; &#160;var ret = jQuery("#list5").getRowData(id);<br />&#160;&#160; &#160;&#160;&#160; &#160;alert("id="+ret.id+" invdate="+ret.invdate+"...");<br />&#160;&#160; &#160;} else { alert("Please select row");}<br />});</p>
<p>jQuery("#a2").click( function(){<br />&#160;&#160; &#160;var su=jQuery("#list5").delRowData(12);<br />&#160;&#160; &#160;if(su) alert("Succes. Write custom code to delete row from server"); else alert("Allready deleted or not in list");<br />});</p>
<p>jQuery("#a3").click( function(){<br />&#160;&#160; &#160;var su=jQuery("#list5").setRowData(11,{amount:"333.00",tax:"33.00",total:"366.00",note:"&#60;img src=&#39;images/user1.gif&#39;/&#62;"});<br />&#160;&#160; &#160;if(su) alert("Succes. Write custom code to update row in server"); else alert("Can not update");<br />});</p>
<p>jQuery("#a4").click( function(){<br />&#160;&#160; &#160;var datarow = {id:"99",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"};<br />&#160;&#160; &#160;var su=jQuery("#list5").addRowData(99,datarow);<br />&#160;&#160; &#160;if(su) alert("Succes. Write custom code to add data in server"); else alert("Can not update");<br />});</p>
</p>
<p><span style="text-decoration: underline;"><strong>3. griddata.jsp:</strong></span></p>
</p>
<p>&#60;%@ page import="java.sql.*,java.util.ArrayList" language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%&#62;<br />&#60;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&#62;<br />&#60;%@page import="net.sf.json.JSONObject"%&#62;<br />&#60;html&#62;<br />&#60;head&#62;<br />&#60;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&#62;<br />&#60;title&#62;Invoice Grid&#60;/title&#62;<br />&#60;/head&#62;<br />&#60;body&#62;<br />&#160;&#160; &#160;&#60;% <br />&#160;&#160; &#160;&#160;&#160; &#160;String rows=request.getParameter("rows");<br />&#160;&#160; &#160;&#160;&#160; &#160;String pageno=request.getParameter("page");&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;System.out.println("Rows &#38; Page : "+ rows+ "&#160;&#160;&#160; "+ pageno);<br />&#160;&#160; &#160;&#160;&#160; &#160;String cpage=pageno;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;Connection connect = null;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;Statement statement = null;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;PreparedStatement preparedStatement = null;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;ResultSet rs= null;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;Class.forName("com.mysql.jdbc.Driver").newInstance();&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;connect = DriverManager.getConnection("jdbc:mysql://localhost/test?user=root&#38;password=root");&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;statement = connect.createStatement();&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;rs = statement.executeQuery("SELECT COUNT(*) AS count FROM invheader a, clients b WHERE a.client_id=b.client_id");&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;int count=0;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;rs.last();<br />&#160;&#160; &#160;&#160;&#160; &#160;count=rs.getInt(1); &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;System.out.println("Total No of Records are : "+count);<br />&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;int pageval=0;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;pageval=(count/Integer.parseInt(rows));&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;int limitstart=0;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;limitstart=(Integer.parseInt(rows)*Integer.parseInt(pageno))-Integer.parseInt(rows);&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;int total=count/Integer.parseInt(rows);<br />&#160;&#160; &#160;&#160;&#160; &#160;System.out.println("Limit Start : "+limitstart);<br />&#160;&#160; &#160;&#160;&#160; &#160;System.out.println("Total : "+total);<br />&#160;&#160; &#160;&#160;&#160; &#160;String totalrow=String.valueOf(total+1); &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;System.out.println("Total Row : "+totalrow);<br />&#160;&#160; &#160;&#160;&#160; &#160;rs = statement.executeQuery("SELECT a.id, a.invdate, b.name, a.amount,a.tax,a.total,a.note FROM invheader a, clients b WHERE a.client_id=b.client_id ORDER BY b.name LIMIT "+limitstart+","+rows);<br />&#160;&#160; &#160;&#160;&#160; &#160;//rs = statement.executeQuery("SELECT * FROM grid limit "+limitstart+","+rows);&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;JSONObject responcedata=new JSONObject();&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;net.sf.json.JSONArray cellarray=new net.sf.json.JSONArray();&#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;responcedata.put("total",totalrow);&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;responcedata.put("page",cpage);&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;responcedata.put("records",count);&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;net.sf.json.JSONArray cell = new net.sf.json.JSONArray();&#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;net.sf.json.JSONObject cellobj=new net.sf.json.JSONObject();&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;int i=1;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;while(rs.next())&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;{ &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;//System.out.println("Row#: "+i+"&#160;&#160;&#160;&#160;&#160; ##"+rs.getString(1)+"&#160; :&#160; "+rs.getString(2)+"&#160; :&#160; "+rs.getString(3)+"&#160; :&#160; "+rs.getString(4)+"&#160; :&#160; "+rs.getString(5)+"&#160; :&#160; "+rs.getString(6)+"&#160; :&#160; "+rs.getString(7)+"&#160; :&#160; ");<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;cellobj.put("id",rs.getInt(1));&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;cell.add(rs.getInt(1));&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;cell.add(rs.getString(2));&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;cell.add(rs.getString(3)); <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;cell.add(rs.getDouble(4));<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;cell.add(rs.getDouble(5));<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;cell.add(rs.getDouble(6));<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;cell.add(rs.getString(7));<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;cellobj.put("cell",cell);&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;cell.clear();&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;cellarray.add(cellobj);&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;i++;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;}&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;responcedata.put("rows",cellarray);&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;out.println(responcedata);<br />&#160;&#160; &#160;&#160;&#160; &#160;System.out.println("Response Data : "+responcedata);<br />&#160;&#160; &#160;%&#62;<br />&#160;&#160; &#160;&#160;&#160; &#160;<br />&#60;/body&#62;<br />&#60;/html&#62;</p>
</p>
<p>Can anybody help me? If you have a sample project which uses jqGrid along with JSP, It will be very helpful for me.</p>
</p>
<p>Thanks in advance,</p>
<p>Nobel.</p>
]]></description>
        	        	<pubDate>Tue, 25 Jan 2011 06:17:10 +0200</pubDate>
        </item>
</channel>
</rss>