<?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: Problem when trying to use jqgrid with jsp</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/problem-when-trying-to-use-jqgrid-with-jsp</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/help/problem-when-trying-to-use-jqgrid-with-jsp/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>krams on Problem when trying to use jqgrid with jsp</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/problem-when-trying-to-use-jqgrid-with-jsp#p21260</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/problem-when-trying-to-use-jqgrid-with-jsp#p21260</guid>
        	        	<description><![CDATA[<div>
<p>Check this tutorial I wrote:&#160;</p>
<p><a href="http://krams915.blogspot.com/2010/12/jqgrid-and-spring-3-mvc-integration.html" rel="nofollow" target="_blank"><a href="http://krams915.blogspot.com/2" rel="nofollow">http://krams915.blogspot.com/2</a>.....ation.html</a></p>
</div>
]]></description>
        	        	<pubDate>Mon, 13 Dec 2010 01:48:54 +0200</pubDate>
        </item>
        <item>
        	<title>axel9641 on Problem when trying to use jqgrid with jsp</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/problem-when-trying-to-use-jqgrid-with-jsp#p21213</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/problem-when-trying-to-use-jqgrid-with-jsp#p21213</guid>
        	        	<description><![CDATA[</p>
<p>Hi everyone</p>
<p>I&#39;ve trying to adapt the <a rel="nofollow" href="/jqgridwiki/doku.php?id=wiki%3afirst_grid" target="_blank">&#39;My First Grid&#39;</a> from the <a rel="nofollow" href="/jqgridwiki/doku.php" target="_blank">jqgrid wiki</a> to use it with jsp instead of php, but I stil can do it.What do I need to change? Is it neccesary to add <strong>page,limit,count,total_pages</strong>, etc to the <strong>session</strong>?</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7115' value='Select Code' data-codeid='sfcode7115' /></p>
<div class='sfcode' id='sfcode7115'>public class MantenimientoPrueba implements Controller {&#160;<br />&#160;<br />private Integer page;&#160;<br />private Integer limit;&#160;<br />private Integer count, total_pages, start;&#160;<br />private String sidx = null;&#160;<br />private String sord = null;&#160;<br />private String s = null;&#160;<br />HttpSession session = null;&#160;<br />&#160;<br />public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {&#160;<br />&#160;<br />&#160; &#160; session = request.getSession();&#160;<br />&#160;<br />&#160; &#160; page = Integer.parseInt(request.getParameter(&#34;page&#34;));&#160;<br />&#160; &#160; limit = Integer.parseInt(request.getParameter(&#34;rows&#34;));&#160;<br />&#160;<br />&#160; &#160; sidx = request.getParameter(&#34;sidx&#34;);&#160;<br />&#160; &#160; sord = request.getParameter(&#34;sord&#34;);&#160;<br />&#160;<br />&#160;<br />&#160; &#160; if (!sidx.equals(&#34;&#34;)) {&#160;<br />&#160; &#160; &#160; &#160; sidx = &#34;invid&#34;;&#160;<br />&#160; &#160; }&#160;<br />&#160; &#160; RNPrueba facade = new RNPrueba();&#160;<br />&#160; &#160; List&#60;Prueba&#62; tab = new ArrayList(1);&#160;<br />&#160;<br />&#160; &#160; //&#39;ContarConsultarTodos&#39; calculates the number of rows for the query&#160;<br />&#160; &#160; count = facade.ContarConsultarTodos();&#160;<br />&#160;<br />&#160; &#160; if (count &#62; 0 &#38;&#38; limit &#62; 0) {&#160;<br />&#160; &#160; &#160; &#160; total_pages = (int) (count / limit);&#160;<br />&#160; &#160; } else {&#160;<br />&#160; &#160; &#160; &#160; total_pages = 0;&#160;<br />&#160; &#160; }&#160;<br />&#160;<br />&#160;<br />&#160; &#160; if (page &#62; total_pages) {&#160;<br />&#160; &#160; &#160; &#160; page = total_pages;&#160;<br />&#160; &#160; }&#160;<br />&#160;<br />&#160;<br />&#160; &#160; start = limit * page &#8211; limit;&#160;<br />&#160;<br />&#160;<br />&#160; &#160; if (start &#60; 0) {&#160;<br />&#160; &#160; &#160; &#160; start = 0;&#160;<br />&#160; &#160; }&#160;<br />&#160; &#160; //&#39;ConsultarTodos&#39; gets all the rows&#160;<br />&#160; &#160; tab = facade.ConsultarTodos(sidx, sord, start, limit);&#160;<br />&#160; &#160; s = &#34;&#60;?xml version=&#39;1.0&#39; encoding=&#39;utf-8&#39;?&#62;&#34;;&#160;<br />&#160; &#160; s += &#34;&#60;rows&#62;&#34;;&#160;<br />&#160; &#160; s += &#34;&#60;page&#62;&#34; + page + &#34;&#60;/page&#62;&#34;;&#160;<br />&#160; &#160; s += &#34;&#60;total&#62;&#34; + total_pages + &#34;&#60;/total&#62;&#34;;&#160;<br />&#160; &#160; s += &#34;&#60;records&#62;&#34; + count + &#34;&#60;/records&#62;&#34;;&#160;<br />&#160;<br />&#160;<br />&#160; &#160; for (int i = 0; i &#60; tab.size(); i++) {&#160;<br />&#160; &#160; &#160; &#160; s += &#34;&#60;row id=&#39;&#34; + tab.get(i).getInvid() + &#34;&#39;&#62;&#34;;&#160;<br />&#160; &#160; &#160; &#160; s += &#34;&#60;cell&#62;&#34; + tab.get(i).getInvid() + &#34;&#60;/cell&#62;&#34;;&#160;<br />&#160; &#160; &#160; &#160; s += &#34;&#60;cell&#62;&#34; + tab.get(i).getInvdate() + &#34;&#60;/cell&#62;&#34;;&#160;<br />&#160; &#160; &#160; &#160; s += &#34;&#60;cell&#62;&#34; + tab.get(i).getAmount() + &#34;&#60;/cell&#62;&#34;;&#160;<br />&#160; &#160; &#160; &#160; s += &#34;&#60;cell&#62;&#34; + tab.get(i).getTax() + &#34;&#60;/cell&#62;&#34;;&#160;<br />&#160; &#160; &#160; &#160; s += &#34;&#60;cell&#62;&#34; + tab.get(i).getTotal() + &#34;&#60;/cell&#62;&#34;;&#160;<br />&#160; &#160; &#160; &#160; s += &#34;&#60;cell&#62;&#60;![CDATA[&#34; + tab.get(i).getNote() + &#34;]]&#62;&#60;/cell&#62;&#34;;&#160;<br />&#160; &#160; &#160; &#160; s += &#34;&#60;/row&#62;&#34;;&#160;<br />&#160; &#160; }&#160;<br />&#160; &#160; s += &#34;&#60;/rows&#62;&#34;;&#160;<br />&#160; &#160; System.out.println(s);&#160;<br />&#160; &#160; return new ModelAndView(&#34;mantenimiento.prueba&#34;);&#160;<br />&#160; }&#160;&#160;&#160;}&#160;&#160;&#160;</div>
<p>Another thing I don&#39;t know how to adapt is this:</p>
<pre class="prettyprint"><p><input type='button' class='sfcodeselect' name='sfselectit8018' value='Select Code' data-codeid='sfcode8018' /></p><div class='sfcode' id='sfcode8018'>header(&#34;Content-type: text/xml;charset=utf-8&#34;);&#160;</div></pre>
</p>
<p>And since the java code (shown above) inside the <strong>SourcePackages</strong> in a package called: &#39;Mantenimiento&#39; I&#39;d would like to know, how I have to call this file (MantenimientoPrueba.java) from my jsp file , that is where the jqgrid is.</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8833' value='Select Code' data-codeid='sfcode8833' /></p>
<div class='sfcode' id='sfcode8833'>
<p>$(function(){&#160;<br />&#160; &#160; &#160; &#160; &#160; &#160; $(&#34;#list&#34;).jqGrid({&#160;&#160;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <a href=&#34;/blog/&#39;mantenimientoprueba.htm&#39;&#34; target="_blank">url:&#39;mantenimientoprueba.htm&#39;</a>,&#160;&#160;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; //...some other code&#160;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });&#160;</p>
</div>
<p>Should I use this url?, which is the name I give to <strong>MantenimientoPrueba.java</strong> in the <strong>spring-servlet.xml</strong>,or shoul I just use <strong>MantenimientoPrueba.java</strong>?</p>
<p>I really hope you can help me out,thanks in advance</p>
<p>PS:I&#39;m using Jsp with Spring and &#8230; sorry for my bad English<img class="spSmiley" style="margin:0" title="Embarassed" src="/blog/wp-content/forum-smileys/sf-embarassed.gif" alt="Embarassed" /></p>
]]></description>
        	        	<pubDate>Tue, 07 Dec 2010 21:33:43 +0200</pubDate>
        </item>
</channel>
</rss>