<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rule of Tech &#187; Programming</title>
	<atom:link href="http://ruleoftech.com/journal/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://ruleoftech.com</link>
	<description>Everything and nothing but still something about Tech</description>
	<lastBuildDate>Thu, 02 Feb 2012 14:58:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using RichFaces 3 dataScroller and dataTable -components</title>
		<link>http://ruleoftech.com/journal/using-richfaces-3-datascroller-and-datatable-components</link>
		<comments>http://ruleoftech.com/journal/using-richfaces-3-datascroller-and-datatable-components#comments</comments>
		<pubDate>Tue, 10 Nov 2009 10:59:47 +0000</pubDate>
		<dc:creator>Marko</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[richfaces]]></category>

		<guid isPermaLink="false">http://ruleoftech.wordpress.com/?p=54</guid>
		<description><![CDATA[<p><a href="http://www.jboss.org/richfaces">RichFaces</a> provides some nice AJAX-components for Java Server Faces but the documentation and examples could be better. RichFaces has great documentation compared to some other frameworks but it could be better with adding a little bit of real world and down to earth examples. So here is one example of using RichFaces <a href="http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_datascroller.html">dataScroller</a> and <a href="http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_dataTable.html">dataTable </a>-components with custom CSS-styling, backingBean and JSF-page snippets using Richfaces 3.3.2.SR1 and JSF 1.2_12.&#8230; <a href="http://ruleoftech.com/journal/using-richfaces-3-datascroller-and-datatable-components" class="read_more">Continue reading <span class=\\\"meta-nav\\\">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jboss.org/richfaces">RichFaces</a> provides some nice AJAX-components for Java Server Faces but the documentation and examples could be better. RichFaces has great documentation compared to some other frameworks but it could be better with adding a little bit of real world and down to earth examples. So here is one example of using RichFaces <a href="http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_datascroller.html">dataScroller</a> and <a href="http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_dataTable.html">dataTable </a>-components with custom CSS-styling, backingBean and JSF-page snippets using Richfaces 3.3.2.SR1 and JSF 1.2_12.</p>
<p>Using RichFaces dataScroller and dataTable components has a big negative property: they work nicely if the amount of data is small but when the row count reaches to thousands they become sluggish or stop working.  The rich:dataScroller needs the complete datamodel being loaded into memory and only displays a part of it. Not very efficient if the rowcount exceeds 1000 or so.</p>
<p>Anyways here is some real world example. The icons used in the examples for dataScroller are from <a href="http://www.everaldo.com/crystal/">Crystal Project Icons</a>.</p>
<h3>JSF-page</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:form</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;myForm&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rich:dataScroller</span> <span style="color: #000066;">styleClass</span>=<span style="color: #ff0000;">&quot;dataScroller&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;scroller&quot;</span> </span>
<span style="color: #009900;">        <span style="color: #000066;">for</span>=<span style="color: #ff0000;">&quot;resultTable&quot;</span> <span style="color: #000066;">maxPages</span>=<span style="color: #ff0000;">&quot;15&quot;</span> <span style="color: #000066;">fastStep</span>=<span style="color: #ff0000;">&quot;3&quot;</span></span>
<span style="color: #009900;">        <span style="color: #000066;">renderIfSinglePage</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">immediate</span>=<span style="color: #ff0000;">&quot;false&quot;</span> </span>
<span style="color: #009900;">        <span style="color: #000066;">binding</span>=<span style="color: #ff0000;">&quot;#{backingBean.scroller}&quot;</span> <span style="color: #000066;">page</span>=<span style="color: #ff0000;">&quot;#{backingBean.scrollerPage}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;first&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:graphicImage</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;firstImage&quot;</span> <span style="color: #000066;">styleClass</span>=<span style="color: #ff0000;">&quot;scroller&quot;</span> </span>
<span style="color: #009900;">            <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;images/crystal/tab_first.png&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;first&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;last&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:graphicImage</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;lastImage&quot;</span> <span style="color: #000066;">styleClass</span>=<span style="color: #ff0000;">&quot;scroller&quot;</span> </span>
<span style="color: #009900;">                <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;images/crystal/tab_last.png&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;last&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;previous&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:graphicImage</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;prevImage&quot;</span> <span style="color: #000066;">styleClass</span>=<span style="color: #ff0000;">&quot;scroller&quot;</span> </span>
<span style="color: #009900;">                <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;images/crystal/tab_left.png&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;previous&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;next&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:graphicImage</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;nextImage&quot;</span> <span style="color: #000066;">styleClass</span>=<span style="color: #ff0000;">&quot;scroller&quot;</span> </span>
<span style="color: #009900;">                <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;images/crystal/tab_right.png&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;previous&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;fastforward&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:graphicImage</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;ffImage&quot;</span> <span style="color: #000066;">styleClass</span>=<span style="color: #ff0000;">&quot;scroller&quot;</span> </span>
<span style="color: #009900;">                <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;images/crystal/tab_fastf.png&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;next&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;fastrewind&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:graphicImage</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;frImage&quot;</span> <span style="color: #000066;">styleClass</span>=<span style="color: #ff0000;">&quot;scroller&quot;</span> </span>
<span style="color: #009900;">                <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;images/crystal/tab_fastr.png&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;next&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;first_disabled&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:graphicImage</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;firstImage_d&quot;</span> <span style="color: #000066;">styleClass</span>=<span style="color: #ff0000;">&quot;scroller&quot;</span> </span>
<span style="color: #009900;">                <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;images/crystal/tab_first.png&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;first&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;last_disabled&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:graphicImage</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;lastImage_d&quot;</span> <span style="color: #000066;">styleClass</span>=<span style="color: #ff0000;">&quot;scroller&quot;</span> </span>
<span style="color: #009900;">                <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;images/crystal/tab_last.png&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;last&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;previous_disabled&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:graphicImage</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;prevImage_d&quot;</span> <span style="color: #000066;">styleClass</span>=<span style="color: #ff0000;">&quot;scroller&quot;</span> </span>
<span style="color: #009900;">                <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;images/crystal/tab_left.png&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;previous&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;next_disabled&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:graphicImage</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;nextImage_d&quot;</span> <span style="color: #000066;">styleClass</span>=<span style="color: #ff0000;">&quot;scroller&quot;</span> </span>
<span style="color: #009900;">                <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;images/crystal/tab_right.png&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;next&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;fastforward_disabled&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:graphicImage</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;ffImage_d&quot;</span> <span style="color: #000066;">styleClass</span>=<span style="color: #ff0000;">&quot;scroller&quot;</span> </span>
<span style="color: #009900;">                <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;images/crystal/tab_fastf.png&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;next&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;fastrewind_disabled&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:graphicImage</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;frImage_d&quot;</span> <span style="color: #000066;">styleClass</span>=<span style="color: #ff0000;">&quot;scroller&quot;</span> </span>
<span style="color: #009900;">                <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;images/crystal/tab_fastr.png&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;previous&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;controlsSeparator&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:outputText</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;sep&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot; &quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rich:dataScroller<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rich:dataTable</span> <span style="color: #000066;">styleClass</span>=<span style="color: #ff0000;">&quot;resultTable&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;resultTable&quot;</span> </span>
<span style="color: #009900;">    <span style="color: #000066;">rows</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #000066;">rowClasses</span>=<span style="color: #ff0000;">&quot;,odd&quot;</span>  <span style="color: #000066;">columnClasses</span>=<span style="color: #ff0000;">&quot;col&quot;</span>  </span>
<span style="color: #009900;">    <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;#{backingBean.resultList}&quot;</span> <span style="color: #000066;">binding</span>=<span style="color: #ff0000;">&quot;#{backingBean.resultData}&quot;</span> </span>
<span style="color: #009900;">    <span style="color: #000066;">var</span>=<span style="color: #ff0000;">&quot;h&quot;</span> <span style="color: #000066;">sortMode</span>=<span style="color: #ff0000;">&quot;multi&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rich:column</span> <span style="color: #000066;">sortBy</span>=<span style="color: #ff0000;">&quot;#{h.desc}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;header&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:outputText</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;description&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:commandLink</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;#{h.desc}&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">action</span>=<span style="color: #ff0000;">&quot;#{backingBean.showRowData}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:param</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;selectedRow&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;#{h.desc&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h:commandLink<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rich:column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rich:column</span> <span style="color: #000066;">sortBy</span>=<span style="color: #ff0000;">&quot;#{h.value}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;header&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:outputText</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;value&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:outputText</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;#{h.value}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rich:column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rich:dataTable<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h:form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<h3>Backing Bean</h3>
<p>Create some variables for dataScroller and getters and setters for them:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// RichFaces dataScroller variables</span>
<span style="color: #000000; font-weight: bold;">private</span> HtmlDatascroller scroller = <span style="color: #000000; font-weight: bold;">new</span> HtmlDatascroller<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399; font-weight: bold;">String</span> scrollerPage = <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Getting the clicked row's data</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> showRowdata<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  MyDataModel current = <span style="color: #009900;">&#40;</span>myDataModel<span style="color: #009900;">&#41;</span> getResultData<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getRowData</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h3>CSS styling</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* =RichFaces DataScroller
----------------------------------------------- */</span>
<span style="color: #6666ff;">.rich-datascr</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.1em</span><span style="color: #00AA00;">;</span>border<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
.rich-<span style="color: #993333;">table-cell</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.0em</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.rich-table-sortable-header</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.1em</span><span style="color: #00AA00;">;</span>font-weight<span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
td<span style="color: #6666ff;">.rich-datascr-button</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>border<span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>text-decoration<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
td<span style="color: #6666ff;">.rich-datascr-button-dsbld</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.rich-datascr-ctrls-separator</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.rich-dtascroller-table</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>border<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.scroller</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>background-<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>border<span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>padding<span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>margin<span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>text-decoration<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.scroller</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#eee</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
td<span style="color: #6666ff;">.rich-datascr-button-dsbld</span> <span style="color: #6666ff;">.scroller</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#eee</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
td<span style="color: #6666ff;">.rich-datascr-inact</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.2em</span><span style="color: #00AA00;">;</span>color<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>border<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
td<span style="color: #6666ff;">.rich-datascr-inact</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">underline</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
td<span style="color: #6666ff;">.rich-datascr-act</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.2em</span><span style="color: #00AA00;">;</span>text-decoration<span style="color: #00AA00;">:</span> <span style="color: #993333;">underline</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
td<span style="color: #6666ff;">.rich-datascr-act</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>font-weight<span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h3>Selecting All rows with JavaScript</h3>
<p>Add to the JSF-page a new column which has the checkbox. We are using JavaScript to loop through the input fields which are after :tu -ending id-field.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">&lt;rich:column&gt;
  &lt;f:facet name=&quot;header&quot;&gt;
    &lt;h:panelGroup layout=&quot;block&quot;&gt;
      <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
        <span style="color: #006600; font-style: italic;">//&lt;![CDATA[</span>
        <span style="color: #006600; font-style: italic;">// RichFaces datatable select all -checkbox</span>
        <span style="color: #003366; font-weight: bold;">function</span> checkAllCheckboxesInTable<span style="color: #009900;">&#40;</span> inputId<span style="color: #339933;">,</span> state <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
          <span style="color: #003366; font-weight: bold;">var</span> commonIdPart <span style="color: #339933;">=</span> inputId.<span style="color: #660066;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> inputId.<span style="color: #660066;">lastIndexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">':'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #003366; font-weight: bold;">var</span> tableId <span style="color: #339933;">=</span> commonIdPart <span style="color: #339933;">+</span> <span style="color: #3366CC;">':tu'</span>
          <span style="color: #003366; font-weight: bold;">var</span> tableElement <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span> tableId <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #003366; font-weight: bold;">var</span> inputs <span style="color: #339933;">=</span> tableElement.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;=</span> inputs.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> input <span style="color: #339933;">=</span> inputs<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>input <span style="color: #339933;">!=</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
              <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> input.<span style="color: #660066;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'type'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'checkbox'</span> <span style="color: #339933;">&amp;&amp;</span> state<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                input.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'checked'</span><span style="color: #339933;">,</span> state<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
              <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
                input.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'checked'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                input.<span style="color: #660066;">removeAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'checked'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
              <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
          <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #006600; font-style: italic;">//]]&gt;</span>
      <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
      &lt;h:selectBooleanCheckbox id=&quot;t0&quot; onclick=&quot;checkAllCheckboxesInTable( this.id, this.checked );&quot;&gt;
        &lt;a4j:support event=&quot;onchange&quot; reRender=&quot;resultTable&quot;/&gt;
      &lt;/h:selectBooleanCheckbox&gt;
    &lt;/h:panelGroup&gt;
  &lt;/f:facet&gt;
  &lt;h:selectBooleanCheckbox id=&quot;t1&quot; value=&quot;#{h.selected}&quot; /&gt;
&lt;/rich:column&gt;</pre></td></tr></table></div>

<h3>Selecting All rows in backing bean</h3>
<p>You can also check all the checkboxes from the backingBean but it has problems with table ordering and when the lists order changes the selection goes wrong.</p>
<p>Add to the JSF-page a new column:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rich:column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:facet</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;header&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:selectBooleanCheckbox</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;t0&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;#{backingBean.selectedAll}&quot;</span> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">&quot;this.blur()&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a4j:support</span> <span style="color: #000066;">event</span>=<span style="color: #ff0000;">&quot;onchange&quot;</span> <span style="color: #000066;">actionListener</span>=<span style="color: #ff0000;">&quot;#{backingBean.selectAll}&quot;</span> <span style="color: #000066;">reRender</span>=<span style="color: #ff0000;">&quot;resultTable, t0, t1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h:selectBooleanCheckbox<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:facet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:selectBooleanCheckbox</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;t1&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;#{h.selected}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rich:column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Make a new method to your backingBean:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> selectAll<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">ActionEvent</span> event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	logger.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;*** backingBean.selectAll(): &quot;</span> + scrollerPage + <span style="color: #0000ff;">&quot; ***&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// get the current scroller page</span>
	<span style="color: #006600; font-weight: bold;">int</span> page = <span style="color: #003399; font-weight: bold;">Integer</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>scrollerPage<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">intValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>page <span style="color: #339933;">!</span>= <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    page = page - <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #006600; font-weight: bold;">int</span> start = page <span style="color: #339933;">*</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
	<span style="color: #006600; font-weight: bold;">int</span> stop = <span style="color: #009900;">&#40;</span>page <span style="color: #339933;">*</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span> + <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
	<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>stop <span style="color: #339933;">&gt;</span> getResultList<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    stop = getResultList<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	logger.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&gt; page: &quot;</span> + page + <span style="color: #0000ff;">&quot;; start: &quot;</span> + start + <span style="color: #0000ff;">&quot;; stop: &quot;</span> + stop<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// check the boxes on the active page</span>
	<span style="color: #000000;  font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #006600; font-weight: bold;">int</span> i = start<span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> stop<span style="color: #339933;">;</span> i++<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    logger.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&gt; valitaan: &quot;</span> + i + <span style="color: #0000ff;">&quot;; &quot;</span> + selectedAll<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    getResultList<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setSelected</span><span style="color: #009900;">&#40;</span>selectedAll<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h2  class="related_post_title">Related journal entries</h2><ul class="related_post"><li><a href="http://ruleoftech.com/journal/installing-sun-jdk-1-6-on-centos" title="Installing Sun JDK 1.6 on CentOS">Installing Sun JDK 1.6 on CentOS</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://ruleoftech.com/journal/using-richfaces-3-datascroller-and-datatable-components/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Eclipse: Class file name must end with .class exception in search</title>
		<link>http://ruleoftech.com/journal/eclipse-class-file-name-must-end-with-class-exception-in-search</link>
		<comments>http://ruleoftech.com/journal/eclipse-class-file-name-must-end-with-class-exception-in-search#comments</comments>
		<pubDate>Wed, 04 Nov 2009 10:50:03 +0000</pubDate>
		<dc:creator>Marko</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[problems]]></category>

		<guid isPermaLink="false">http://ruleoftech.wordpress.com/?p=52</guid>
		<description><![CDATA[<p>Eclipse is nice IDE but it has it&#8217;s own problems. This time the Java Search and Open Type -search produced an error saying &#8220;Class file name must end with .class&#8221;. Very helpfull. Fortunately almost all the answers in the world can be found in the Internet and so with a quick googling the solution to this annoying problem was found on <a href="http://stackoverflow.com/questions/6816/eclipse-class-file-name-must-end-with-class-exception-in-java-search">Stack Overflow</a>.&#8230; <a href="http://ruleoftech.com/journal/eclipse-class-file-name-must-end-with-class-exception-in-search" class="read_more">Continue reading <span class=\\\"meta-nav\\\">&#8594;</span></a></p>]]></description>
			<content:encoded><![CDATA[<p>Eclipse is nice IDE but it has it&#8217;s own problems. This time the Java Search and Open Type -search produced an error saying &#8220;Class file name must end with .class&#8221;. Very helpfull. Fortunately almost all the answers in the world can be found in the Internet and so with a quick googling the solution to this annoying problem was found on <a href="http://stackoverflow.com/questions/6816/eclipse-class-file-name-must-end-with-class-exception-in-java-search">Stack Overflow</a>.</p>
<p>I had already tried Project -&gt; Clean&#8230; and closing Eclipse, deleting all the built class files and restarting Eclipse to no avail as was the original question author. The right answer lies in deleting the corrupted search index which is explained in <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=269820#c9">Eclipse bug&#8217;s #269820 comment</a>.</p>
<p>How to delete the search index:</p>
<ol>
<li>Close Eclipse</li>
<li>Delete workspace/.metadata/.plugins/org.eclipse.jdt.core/*.index</li>
<li>Delete workspace/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt</li>
<li>Start Eclipse again</li>
</ol>
<p>This fixed the issue for me.</p>
<h2  class="related_post_title">Related journal entries</h2><ul class="related_post"><li><a href="http://ruleoftech.com/journal/eclipse-and-maven-console" title="Eclipse and Maven Console">Eclipse and Maven Console</a></li><li><a href="http://ruleoftech.com/journal/samba-performance-problem-after-kernel-update" title="Samba performance problem after kernel update">Samba performance problem after kernel update</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://ruleoftech.com/journal/eclipse-class-file-name-must-end-with-class-exception-in-search/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

