<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Codeless Ajax Ordered and Paginated Tables in Seam</title>
	<atom:link href="http://www.andygibson.net/blog/tutorial/codeless-ajax-ordered-and-paginated-tables-in-seam/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.andygibson.net/blog/tutorial/codeless-ajax-ordered-and-paginated-tables-in-seam/</link>
	<description>Open Source Projects &#38; Technical Writings</description>
	<lastBuildDate>Wed, 18 Jan 2012 00:05:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Andy Gibson</title>
		<link>http://www.andygibson.net/blog/tutorial/codeless-ajax-ordered-and-paginated-tables-in-seam/comment-page-1/#comment-16090</link>
		<dc:creator>Andy Gibson</dc:creator>
		<pubDate>Fri, 20 May 2011 04:24:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=24#comment-16090</guid>
		<description>Do you have disabled=&quot;#{not bean.previousExists}&quot; or something like that? That will break it. I found a bug where when the model is rebuilt, the first page is 0 and previousexists = false and the component is disabled. It doesn&#039;t matter that when the values are applied you are on page 10 or whatever.  I already filed a bug for it.</description>
		<content:encoded><![CDATA[<p>Do you have disabled=&#8221;#{not bean.previousExists}&#8221; or something like that? That will break it. I found a bug where when the model is rebuilt, the first page is 0 and previousexists = false and the component is disabled. It doesn&#8217;t matter that when the values are applied you are on page 10 or whatever.  I already filed a bug for it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.andygibson.net/blog/tutorial/codeless-ajax-ordered-and-paginated-tables-in-seam/comment-page-1/#comment-16079</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Tue, 12 Apr 2011 20:49:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=24#comment-16079</guid>
		<description>Thanks so much for this article!  It&#039;s been EXTREMELY helpful.  I&#039;ve implemented the code in my application with no problem.  The &#039;Next&#039; button works just fine, but for whatever reason my &#039;Previous&#039; button doesn&#039;t.  I added a few debugging statements and can see that &#039;previousExists == true&#039;, however nothing happens when I click the Previous button.  I don&#039;t even see the call getting back to my EntityQuery object.  Have you ever seen something like this?</description>
		<content:encoded><![CDATA[<p>Thanks so much for this article!  It&#8217;s been EXTREMELY helpful.  I&#8217;ve implemented the code in my application with no problem.  The &#8216;Next&#8217; button works just fine, but for whatever reason my &#8216;Previous&#8217; button doesn&#8217;t.  I added a few debugging statements and can see that &#8216;previousExists == true&#8217;, however nothing happens when I click the Previous button.  I don&#8217;t even see the call getting back to my EntityQuery object.  Have you ever seen something like this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WA</title>
		<link>http://www.andygibson.net/blog/tutorial/codeless-ajax-ordered-and-paginated-tables-in-seam/comment-page-1/#comment-15985</link>
		<dc:creator>WA</dc:creator>
		<pubDate>Wed, 05 Jan 2011 03:07:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=24#comment-15985</guid>
		<description>Amazing -  Thanks a lot for shedding light on this. I am amazed that richfaces and Seam haven&#039;t published something similar. Thanks a lot.</description>
		<content:encoded><![CDATA[<p>Amazing &#8211;  Thanks a lot for shedding light on this. I am amazed that richfaces and Seam haven&#8217;t published something similar. Thanks a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Gibson</title>
		<link>http://www.andygibson.net/blog/tutorial/codeless-ajax-ordered-and-paginated-tables-in-seam/comment-page-1/#comment-14722</link>
		<dc:creator>Andy Gibson</dc:creator>
		<pubDate>Mon, 06 Sep 2010 21:22:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=24#comment-14722</guid>
		<description>In a nutshell, you can&#039;t. The components.xml definitions for the Seam Framework used a special syntax. Typically, I override the ExtendedEntityQuery, give it a name, put the order key setup in the constructor and I&#039;m done. Plus, you can add other related bits of information to the class.

Cheers,

Andy Gibson</description>
		<content:encoded><![CDATA[<p>In a nutshell, you can&#8217;t. The components.xml definitions for the Seam Framework used a special syntax. Typically, I override the ExtendedEntityQuery, give it a name, put the order key setup in the constructor and I&#8217;m done. Plus, you can add other related bits of information to the class.</p>
<p>Cheers,</p>
<p>Andy Gibson</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dario</title>
		<link>http://www.andygibson.net/blog/tutorial/codeless-ajax-ordered-and-paginated-tables-in-seam/comment-page-1/#comment-14721</link>
		<dc:creator>Dario</dc:creator>
		<pubDate>Mon, 06 Sep 2010 14:49:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=24#comment-14721</guid>
		<description>THanks for this tutorial, i&#039;m finally getting my pagination and ordering works!

I have a question: How do I set a class extending the ExtendedEntityQuery in components.xml. Is that the &quot;class&quot; attribute? And how can i ovverride the constructor for settings lines like getOrderKeyFieldMap().put(&quot;id&quot;, &quot;p.id&quot;) in the components.xml? Thanks</description>
		<content:encoded><![CDATA[<p>THanks for this tutorial, i&#8217;m finally getting my pagination and ordering works!</p>
<p>I have a question: How do I set a class extending the ExtendedEntityQuery in components.xml. Is that the &#8220;class&#8221; attribute? And how can i ovverride the constructor for settings lines like getOrderKeyFieldMap().put(&#8220;id&#8221;, &#8220;p.id&#8221;) in the components.xml? Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricardo</title>
		<link>http://www.andygibson.net/blog/tutorial/codeless-ajax-ordered-and-paginated-tables-in-seam/comment-page-1/#comment-14275</link>
		<dc:creator>Ricardo</dc:creator>
		<pubDate>Thu, 03 Dec 2009 11:46:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=24#comment-14275</guid>
		<description>Do you have .css for this dataTable? 

Thanks for this tutorial</description>
		<content:encoded><![CDATA[<p>Do you have .css for this dataTable? </p>
<p>Thanks for this tutorial</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Gibson</title>
		<link>http://www.andygibson.net/blog/tutorial/codeless-ajax-ordered-and-paginated-tables-in-seam/comment-page-1/#comment-11132</link>
		<dc:creator>Andy Gibson</dc:creator>
		<pubDate>Tue, 28 Apr 2009 01:29:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=24#comment-11132</guid>
		<description>VK, The source you refer to doesn&#039;t use a Seam type of query, the code works off a bare bones hibernate query which is different. 

In theory, you could override the getEntityManager() method in the EntityQuery or the ExtendedEntityQuery I use and return the FullTextEntityManager they use in your reference. However, the style of querying is completely different so I&#039;m not sure they share enough common code to work well. 

To be honest, though, the pagination code isn&#039;t that difficult, you could just create a full text search query which takes a class as a parameter and re-write the code for firstResult, count, first, next, last, etc in no time. 

The EntityQuery objects do subclass some Query objects which you can look and see how good the hierarchy they implemented is. I don&#039;t think it is very open to extension though. I wrote my own query hierarchy that implements the basic pagination stuff and enhanced ordering so you could get a list of results from anything (file list etc) and then extended them for JPA, Hibernate queries, and also to allow for better handling of EL expressions in restrictions. 

The code isn&#039;t that tricky, especially since the EntityQuery pretty much describes what the query needs to do.

Cheers,

Andy</description>
		<content:encoded><![CDATA[<p>VK, The source you refer to doesn&#8217;t use a Seam type of query, the code works off a bare bones hibernate query which is different. </p>
<p>In theory, you could override the getEntityManager() method in the EntityQuery or the ExtendedEntityQuery I use and return the FullTextEntityManager they use in your reference. However, the style of querying is completely different so I&#8217;m not sure they share enough common code to work well. </p>
<p>To be honest, though, the pagination code isn&#8217;t that difficult, you could just create a full text search query which takes a class as a parameter and re-write the code for firstResult, count, first, next, last, etc in no time. </p>
<p>The EntityQuery objects do subclass some Query objects which you can look and see how good the hierarchy they implemented is. I don&#8217;t think it is very open to extension though. I wrote my own query hierarchy that implements the basic pagination stuff and enhanced ordering so you could get a list of results from anything (file list etc) and then extended them for JPA, Hibernate queries, and also to allow for better handling of EL expressions in restrictions. </p>
<p>The code isn&#8217;t that tricky, especially since the EntityQuery pretty much describes what the query needs to do.</p>
<p>Cheers,</p>
<p>Andy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VK</title>
		<link>http://www.andygibson.net/blog/tutorial/codeless-ajax-ordered-and-paginated-tables-in-seam/comment-page-1/#comment-11127</link>
		<dc:creator>VK</dc:creator>
		<pubDate>Mon, 27 Apr 2009 22:39:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=24#comment-11127</guid>
		<description>How could I use your code with Hibernate Search? The SearchAction at http://chiralsoftware.com/hibernate-full-text-search-with-seam/jboss-search.seam uses a Query object, from which getResultList() is called.

How could we get the results from a Hibernate Search-based query into your dataTable that can be paginated/sorted? Could you give some pointers for me to get started down that road?

Thanks.</description>
		<content:encoded><![CDATA[<p>How could I use your code with Hibernate Search? The SearchAction at <a href="http://chiralsoftware.com/hibernate-full-text-search-with-seam/jboss-search.seam" rel="nofollow">http://chiralsoftware.com/hibernate-full-text-search-with-seam/jboss-search.seam</a> uses a Query object, from which getResultList() is called.</p>
<p>How could we get the results from a Hibernate Search-based query into your dataTable that can be paginated/sorted? Could you give some pointers for me to get started down that road?</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mani</title>
		<link>http://www.andygibson.net/blog/tutorial/codeless-ajax-ordered-and-paginated-tables-in-seam/comment-page-1/#comment-7573</link>
		<dc:creator>Mani</dc:creator>
		<pubDate>Wed, 14 Jan 2009 00:33:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=24#comment-7573</guid>
		<description>Thanks a bunch andy. I was able to do what i want.</description>
		<content:encoded><![CDATA[<p>Thanks a bunch andy. I was able to do what i want.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Gibson</title>
		<link>http://www.andygibson.net/blog/tutorial/codeless-ajax-ordered-and-paginated-tables-in-seam/comment-page-1/#comment-7479</link>
		<dc:creator>Andy Gibson</dc:creator>
		<pubDate>Tue, 13 Jan 2009 01:20:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=24#comment-7479</guid>
		<description>Hi Mani, 

Personally, I&#039;ve never really thoroughly implemented page numbers using this method as it requires a record count of the results. However, I would just add a gotoPage method on the entity query and pass in the value from the jsf page link.  In the method, I would have something like : 

&lt;code&gt;
public void gotoPage(int pageNum) {
  firstResult = pageNum * pageSize;
  refresh();
}
&lt;/code&gt;

I&#039;d add a method to get a list of page numbers, put a ui:repeat on there to access the values and use the var as a parameter to the gotoPage method in the paginator: 


&lt;code&gt;
&lt;ui:repeat value=&quot;#{p_queryBean.getPageList}&quot; var=&quot;v_page&quot;&gt;
  &lt;a:commandLink action=&quot;#{p_queryBean.gotoPage(v_page)}&quot; value=&quot;#{v_page}&quot;/&gt;
&lt;/ui:repeat&gt;
&lt;/code&gt;

You can put this in the paginator to get re-use each time by adding the getPageList() method on the entity bean.

By using a pageList method returning a value, you can just return 1 through N, or 1 through 9 and then 15 to 19 if you have a lot of pages. You can also not render the page numbers if your pageList returns null or is empty. Also, if you change your page list strategy down the road, you can change it for all queries by implementing it in the extended entity query.

Hope this helps, 

Cheers,

Andy Gibson

</description>
		<content:encoded><![CDATA[<p>Hi Mani, </p>
<p>Personally, I&#8217;ve never really thoroughly implemented page numbers using this method as it requires a record count of the results. However, I would just add a gotoPage method on the entity query and pass in the value from the jsf page link.  In the method, I would have something like : </p>
<p><code><br />
public void gotoPage(int pageNum) {<br />
  firstResult = pageNum * pageSize;<br />
  refresh();<br />
}<br />
</code></p>
<p>I&#8217;d add a method to get a list of page numbers, put a ui:repeat on there to access the values and use the var as a parameter to the gotoPage method in the paginator: </p>
<p><code><br />
&lt;ui:repeat value="#{p_queryBean.getPageList}" var="v_page"&gt;<br />
  &lt;a:commandLink action="#{p_queryBean.gotoPage(v_page)}" value="#{v_page}"/&gt;<br />
&lt;/ui:repeat&gt;<br />
</code></p>
<p>You can put this in the paginator to get re-use each time by adding the getPageList() method on the entity bean.</p>
<p>By using a pageList method returning a value, you can just return 1 through N, or 1 through 9 and then 15 to 19 if you have a lot of pages. You can also not render the page numbers if your pageList returns null or is empty. Also, if you change your page list strategy down the road, you can change it for all queries by implementing it in the extended entity query.</p>
<p>Hope this helps, </p>
<p>Cheers,</p>
<p>Andy Gibson</p>
]]></content:encoded>
	</item>
</channel>
</rss>

