[richfaces-svn-commits] JBoss Rich Faces SVN: r4659 - in branches/3.1.x/ui/listShuttle/src/main: templates/org/richfaces and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Dec 10 10:17:13 EST 2007


Author: vmolotkov
Date: 2007-12-10 10:17:13 -0500 (Mon, 10 Dec 2007)
New Revision: 4659

Modified:
   branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java
   branches/3.1.x/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
Log:
headers rendering was changed

Modified: branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java
===================================================================
--- branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java	2007-12-10 15:12:34 UTC (rev 4658)
+++ branches/3.1.x/ui/listShuttle/src/main/java/org/richfaces/renderkit/ListShuttleRendererBase.java	2007-12-10 15:17:13 UTC (rev 4659)
@@ -89,6 +89,18 @@
 	public void encodeTLHeader(FacesContext context, UIOrderingBaseComponent shuttle) throws IOException {
 		encodeHeader(context, shuttle, "rich-table-header", "rich-shuttle-header-tab-cell", "sourceHeaderClass");
 	}
+	
+	public boolean isHeaderExists(FacesContext context, UIOrderingBaseComponent component) {
+		Iterator headers = component.columns();
+		while (headers.hasNext()) {
+			UIComponent column = (UIComponent) headers.next();
+			UIComponent facet = column.getFacet("header");
+			if (facet != null) {
+				return true;
+			}
+		}
+		return false;
+	}
 
 	protected String encodeRows(FacesContext context, UIOrderingBaseComponent shuttle, boolean source) throws IOException {
 		ResponseWriter writer = context.getResponseWriter();

Modified: branches/3.1.x/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
===================================================================
--- branches/3.1.x/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx	2007-12-10 15:12:34 UTC (rev 4658)
+++ branches/3.1.x/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx	2007-12-10 15:17:13 UTC (rev 4659)
@@ -75,7 +75,8 @@
 									                		contentContainerStyle = contentContainerStyle.concat("width:").concat(HtmlUtil.qualifySize(sourceListWidthValue)).concat(";");
 									                		variables.setVariable("contentContainerStyle", contentContainerStyle);
 								                		}
-		                							]]>
+														if (isHeaderExists(context, component)) {
+													]]>
 		                						</jsp:scriptlet>
 												<div class="rich-shuttle-list-header" style="#{contentContainerStyle}">
 													<table id="#{clientId}internal_header_tab" class="rich-shuttle-internal-header-tab" cellpadding="0" cellspacing="0">
@@ -84,6 +85,7 @@
 												</div>
 												<jsp:scriptlet>
 													<![CDATA[
+														}
 														String listHeightValue = (String) component.getAttributes().get("listsHeight");
 									                	if (listHeightValue != null) {
 									                		contentContainerStyle = contentContainerStyle.concat("height:").concat(HtmlUtil.qualifySize(listHeightValue)).concat(";");
@@ -135,8 +137,9 @@
 									                		trContentContainerStyle = trContentContainerStyle.concat("width:").concat(HtmlUtil.qualifySize(targetListWidthValue)).concat(";");
 									                		variables.setVariable("trContentContainerStyle", trContentContainerStyle);
 								                		}
-		                							]]>
-		                						</jsp:scriptlet>
+														if (isHeaderExists(context, component)) {
+													]]>
+			                					</jsp:scriptlet>
 												<div class="rich-shuttle-list-header" style="#{trContentContainerStyle}">
 													<table id="#{clientId}tlInternal_header_tab" class="rich-shuttle-internal-header-tab" cellpadding="0" cellspacing="0">
 														<f:call name="encodeTLHeader"/>
@@ -144,6 +147,7 @@
 												</div>
 												<jsp:scriptlet>
 													<![CDATA[
+														}
 									                	if (listHeightValue != null) {
 									                		trContentContainerStyle = trContentContainerStyle.concat("height:").concat(HtmlUtil.qualifySize(listHeightValue)).concat(";");
 									                		variables.setVariable("trContentContainerStyle", trContentContainerStyle);




More information about the richfaces-svn-commits mailing list