<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7762800746447817941</id><updated>2011-07-28T09:34:31.684-07:00</updated><category term='visibility'/><category term='table'/><category term='column'/><category term='header'/><category term='ICEFaces'/><title type='text'>bedniais</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bedniais.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7762800746447817941/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bedniais.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>bedniais</name><uri>http://www.blogger.com/profile/18025006616236730674</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7762800746447817941.post-7583576677235371706</id><published>2008-10-13T04:56:00.000-07:00</published><updated>2008-10-13T05:17:29.024-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visibility'/><category scheme='http://www.blogger.com/atom/ns#' term='column'/><category scheme='http://www.blogger.com/atom/ns#' term='ICEFaces'/><category scheme='http://www.blogger.com/atom/ns#' term='header'/><category scheme='http://www.blogger.com/atom/ns#' term='table'/><title type='text'>ICEFaces: Multiheader tables with column visibility</title><content type='html'>&lt;div&gt;We intended to realize a GUI that could configure visibility of table columns. The requirement was a little bit more sophisticated because we wanted to use a two-row header. The first header row defines a column section. The other one defines individual columns.&lt;br /&gt;As we had decided to use ICEFaces on the project it seemed clear that the rendered attribute of ICEFaces elements is perfectly suited to handle this requirement. But after some testing we realized that there is a bug in the ICEFaces and this attribute is not interpreted correctly in the headerRow element, see &lt;a href="http://jira.icefaces.org/browse/ICE-3136"&gt;http://jira.icefaces.org/browse/ICE-3136&lt;/a&gt;. A response from the ICEFaces team came fast and the bug is fixed in the 1.7.2 release.&lt;br /&gt;Finally we can come to realize the feature. For better understanding let us see an example:&lt;br /&gt;We can choose all columns to be presented in a table. &lt;img id="BLOGGER_PHOTO_ID_5256606897276342818" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_eMrmV-NdbLg/SPM4H1QGUiI/AAAAAAAAAAM/6E30WHPFy50/s320/config1.JPG" border="0" /&gt;&lt;/div&gt;&lt;div&gt;This setting leads to the following table.&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5256607111944401138" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_eMrmV-NdbLg/SPM4UU888PI/AAAAAAAAAAU/rsa4LaV4Ot0/s320/table1.JPG" border="0" /&gt;Then we reconfigure the setting, e.g. we hide the second column.&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5256607259290160722" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_eMrmV-NdbLg/SPM4c526zlI/AAAAAAAAAAc/W69dwLDFTLU/s320/config2.JPG" border="0" /&gt;And we receive a table containing only the first and third column.&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5256607435220126578" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_eMrmV-NdbLg/SPM4nJP5C3I/AAAAAAAAAAk/rDzj08IkM0w/s320/table2.JPG" border="0" /&gt;Well it is effective and simple to implement it with the bug fix mentioned above.&lt;br /&gt;First we must define the first header row. This means to count a number of visible columns in the section for the colspan attribute (&lt;samp&gt;recordConfig.getEventColumnCount()&lt;/samp&gt;). If this number is higher then zero the section as a whole is visible. This is covered in the &lt;samp&gt;recordConfig.isSelectedEvent()&lt;/samp&gt; method.&lt;br /&gt;Then we have to check the visibility of each column in the second header row and do the same for the individual table rows.&lt;br /&gt;And that is all. See the source code for more details.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;samp&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;ice:columngroup&amp;gt;&lt;br /&gt;  &amp;lt;ice:headerrow&amp;gt;&lt;br /&gt;    &amp;lt;ice:column colspan="#{recordConfig.getEventColumnCount()}"&lt;br /&gt;      rendered="#{recordConfig.isSelectedEvent()}"&amp;gt;&lt;br /&gt;      &amp;lt;ice:outputText value="#{i18n.messages['ResultEvent']}"&lt;br /&gt;        rendered="#{recordConfig.isSelectedEvent()}"/&amp;gt;&lt;br /&gt;    &amp;lt;/ice:column&amp;gt;&lt;br /&gt;  &amp;lt;/ice:headerRow&amp;gt;&lt;br /&gt;  &amp;lt;ice:headerrow&amp;gt;&lt;br /&gt;    &amp;lt;ice:column rendered="#{recordConfig.selectedEventWhen}"&amp;gt;&lt;br /&gt;      &amp;lt;ice:outputText value="#{i18n.messages['ResultEventWhen']}"&lt;br /&gt;        rendered="#{recordConfig.selectedEventWhen}"/&amp;gt;&lt;br /&gt;    &amp;lt;/ice:column&amp;gt;&lt;br /&gt;    &amp;lt;ice:column rendered="#{recordConfig.selectedEventOperation}"&amp;gt;&lt;br /&gt;      &amp;lt;ice:outputText value="#{i18n.messages['ResultEventOperation']}"&lt;br /&gt;        rendered="#{recordConfig.selectedEventOperation}"/&amp;gt;&lt;br /&gt;    &amp;lt;/ice:column&amp;gt;&lt;br /&gt;    &amp;lt;ice:column rendered="#{recordConfig.selectedEventType}"&amp;gt;&lt;br /&gt;      &amp;lt;ice:outputText value="#{i18n.messages['ResultEventType']}"&lt;br /&gt;        rendered="#{recordConfig.selectedEventType}"/&amp;gt;&lt;br /&gt;    &amp;lt;/ice:column&amp;gt;&lt;br /&gt;  &amp;lt;/ice:headerRow&amp;gt;&lt;br /&gt;&amp;lt;/ice:columnGroup&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;ice:column rendered="#{recordConfig.selectedEventWhen}"&amp;gt;&lt;br /&gt;  &amp;lt;ice:outputtext value="#{record.eventWhen}"&amp;gt;&lt;br /&gt;&amp;lt;/ice:column&amp;gt;&lt;br /&gt;&amp;lt;ice:column rendered=""&amp;gt;&lt;br /&gt;  &amp;lt;ice:outputtext value="#{record.eventOperation}"&amp;gt;&lt;br /&gt;&amp;lt;/ice:column&amp;gt;&lt;br /&gt;&amp;lt;ice:column rendered="#{recordConfig.selectedEventType}"&amp;gt;&lt;br /&gt;  &amp;lt;ice:outputtext value="#{record.eventType}"&amp;gt;&lt;br /&gt;&amp;lt;/ice:column&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/samp&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7762800746447817941-7583576677235371706?l=bedniais.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bedniais.blogspot.com/feeds/7583576677235371706/comments/default' title='Komentáře k příspěvku'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7762800746447817941&amp;postID=7583576677235371706' title='Počet komentářů: 2'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7762800746447817941/posts/default/7583576677235371706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7762800746447817941/posts/default/7583576677235371706'/><link rel='alternate' type='text/html' href='http://bedniais.blogspot.com/2008/10/icefaces-multiheader-tables-with-column.html' title='ICEFaces: Multiheader tables with column visibility'/><author><name>bedniais</name><uri>http://www.blogger.com/profile/18025006616236730674</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_eMrmV-NdbLg/SPM4H1QGUiI/AAAAAAAAAAM/6E30WHPFy50/s72-c/config1.JPG' height='72' width='72'/><thr:total>2</thr:total></entry></feed>
