<?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>Tue, 07 Sep 2010 07:29:29 +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-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>
	<item>
		<title>By: Mani</title>
		<link>http://www.andygibson.net/blog/tutorial/codeless-ajax-ordered-and-paginated-tables-in-seam/comment-page-1/#comment-7445</link>
		<dc:creator>Mani</dc:creator>
		<pubDate>Mon, 12 Jan 2009 15:38:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=24#comment-7445</guid>
		<description>Hi Andy,

Thanks for the excellent article. It helped me a lot. In my code i have the pagination to show page numbers , i would appreciate your help and guidance on how to make the click on page numbers load the AJAX-ified page using reusable code.

Thanks,
Mani</description>
		<content:encoded><![CDATA[<p>Hi Andy,</p>
<p>Thanks for the excellent article. It helped me a lot. In my code i have the pagination to show page numbers , i would appreciate your help and guidance on how to make the click on page numbers load the AJAX-ified page using reusable code.</p>
<p>Thanks,<br />
Mani</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guillaume Jeudy		Guillaume Jeudy		Guillaume Jeudy</title>
		<link>http://www.andygibson.net/blog/tutorial/codeless-ajax-ordered-and-paginated-tables-in-seam/comment-page-1/#comment-6257</link>
		<dc:creator>Guillaume Jeudy		Guillaume Jeudy		Guillaume Jeudy</dc:creator>
		<pubDate>Mon, 08 Dec 2008 16:36:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=24#comment-6257</guid>
		<description>Sorry, just noticed the link in my previous post is incorrect. Please check out this one: 

http://www-128.ibm.com/developerworks/java/library/j-facelets/</description>
		<content:encoded><![CDATA[<p>Sorry, just noticed the link in my previous post is incorrect. Please check out this one: </p>
<p><a href="http://www-128.ibm.com/developerworks/java/library/j-facelets/" rel="nofollow">http://www-128.ibm.com/developerworks/java/library/j-facelets/</a></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-6228</link>
		<dc:creator>Andy Gibson</dc:creator>
		<pubDate>Sat, 06 Dec 2008 00:32:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.andygibson.net/blog/?p=24#comment-6228</guid>
		<description>Thanks Guillaume, Wrapping it in a custom tag would make it more easier to use and your link looks like a useful article. Perhaps at some point I&#039;ll take a look and write another post about the process when I get some time,

Cheers,

Andy</description>
		<content:encoded><![CDATA[<p>Thanks Guillaume, Wrapping it in a custom tag would make it more easier to use and your link looks like a useful article. Perhaps at some point I&#8217;ll take a look and write another post about the process when I get some time,</p>
<p>Cheers,</p>
<p>Andy</p>
]]></content:encoded>
	</item>
</channel>
</rss>
