Author: dbiatenia
Date: 2007-07-31 11:01:19 -0400 (Tue, 31 Jul 2007)
New Revision: 1954
Modified:
trunk/ui/tabPanel/src/main/config/component/tabPanel.xml
trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabPanelRendererBase.java
trunk/ui/tabPanel/src/main/templates/tabPanel.jspx
Log:
headerAlignment bugfix
Modified: trunk/ui/tabPanel/src/main/config/component/tabPanel.xml
===================================================================
--- trunk/ui/tabPanel/src/main/config/component/tabPanel.xml 2007-07-31 15:00:56 UTC (rev
1953)
+++ trunk/ui/tabPanel/src/main/config/component/tabPanel.xml 2007-07-31 15:01:19 UTC (rev
1954)
@@ -110,7 +110,7 @@
<property>
<name>headerAlignment</name>
<classname>java.lang.String</classname>
- <description>Sets tab headers alignment. It can be "left",
"center" or "right".
+ <description>Sets tab headers alignment. It can be "left" or
"right".
"left" is used by default
</description>
<defaultvalue>"left"</defaultvalue>
Modified:
trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabPanelRendererBase.java
===================================================================
---
trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabPanelRendererBase.java 2007-07-31
15:00:56 UTC (rev 1953)
+++
trunk/ui/tabPanel/src/main/java/org/richfaces/renderkit/TabPanelRendererBase.java 2007-07-31
15:01:19 UTC (rev 1954)
@@ -188,13 +188,14 @@
int count = 0;
String ret = "1";
for (Iterator iter = tabPanel.getTabs(); iter.hasNext();){
+ iter.next();
count++;
}
//center tabs group
ret = String.valueOf(count*2 - 1);
return ret;
}
-
+/*
public void writeColgroups(FacesContext context, UITabPanel tabPanel) throws
IOException{
StringBuffer buff = new StringBuffer();
if("left".equals(tabPanel.getHeaderAlignment())){
@@ -207,7 +208,7 @@
context.getResponseWriter().write(buff.toString());
//return null;
}
-
+*/
public void encodeTabs(FacesContext context, UITabPanel tabPanel) throws IOException
{
ComponentVariables componentVariables =
ComponentsVariableResolver.getVariables(this, tabPanel);
Modified: trunk/ui/tabPanel/src/main/templates/tabPanel.jspx
===================================================================
--- trunk/ui/tabPanel/src/main/templates/tabPanel.jspx 2007-07-31 15:00:56 UTC (rev 1953)
+++ trunk/ui/tabPanel/src/main/templates/tabPanel.jspx 2007-07-31 15:01:19 UTC (rev 1954)
@@ -33,22 +33,39 @@
<tbody>
<tr>
- <td align="#{component.headerAlignment}"><f:call
- name="utils.encodeBeginFormIfNessesary" />
+ <td>
+ <f:call name="utils.encodeBeginFormIfNessesary" />
<table border="0" cellpadding="0"
cellspacing="0">
-
+ <jsp:scriptlet>
+ <![CDATA[
+ String alignment = (String)
component.getAttributes().get("headerAlignment");
+ if("left".equals(alignment)){
+ ]]>
+ </jsp:scriptlet>
+ <colgroup/>
+ <colgroup span="#{this:getTabsCount(context,
component)}"></colgroup>
+ <colgroup width="100%"/>
+ <jsp:scriptlet>
+ <![CDATA[
+ } else {
+ ]]>
+ </jsp:scriptlet>
+ <colgroup width="100%"/>
+ <colgroup span="#{this:getTabsCount(context,
component)}"></colgroup>
+ <colgroup/>
+ <jsp:scriptlet>
+ <![CDATA[
+ }
+ ]]>
+ </jsp:scriptlet>
+
<tr>
<td class="dr-bottom-line">
<img src="#{spacer}" height="1" alt=""
border="0" style="#{this:encodeHeaderSpacing(context,
component)}" />
</td>
<f:call name="encodeTabs" />
- <td class="dr-bottom-line" width="100%">
- <img src="#{spacer}" height="1" alt=""
- border="0" style="#{this:encodeHeaderSpacing(context,
component)}" />
- </td>
-
</tr>
</table>
<div style="display: none;">
Show replies by date