You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2009/02/04 10:09:00 UTC

svn commit: r740660 - in /myfaces/tobago/branches/tobago-1.0.x: sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/

Author: weber
Date: Wed Feb  4 09:08:59 2009
New Revision: 740660

URL: http://svn.apache.org/viewvc?rev=740660&view=rev
Log:
(TOBAGO-740) Alternative SheetRenderer

Modified:
    myfaces/tobago/branches/tobago-1.0.x/sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SimpleSheetRenderer.java
    myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java

Modified: myfaces/tobago/branches/tobago-1.0.x/sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SimpleSheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SimpleSheetRenderer.java?rev=740660&r1=740659&r2=740660&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SimpleSheetRenderer.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/sandbox/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SimpleSheetRenderer.java Wed Feb  4 09:08:59 2009
@@ -55,6 +55,8 @@
   @SuppressWarnings(value = "unchecked")
   public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
     UIData data = (UIData) component;
+    storeFooterHeight(facesContext, data);
+
     if (data.getRowIndex() != -1) {
       // TODO: find why this is needed
       LOG.warn("reset RowIndex");
@@ -152,10 +154,19 @@
     List<UIColumn> renderedColumnList = data.getRenderedColumns();
 
     HtmlStyleMap sheetStyle = (HtmlStyleMap) data.getAttributes().get(TobagoConstants.ATTR_STYLE);
+    Integer sheetHeight = HtmlRendererUtil.getStyleAttributeIntValue(sheetStyle, "height");
+    if (sheetHeight == null) {
+      // FIXME: nullpointer if height not defined
+      LOG.error("no height in parent container, setting to 100");
+      sheetHeight = 100;
+    }
+    int footerHeight = (Integer) data.getAttributes().get(TobagoConstants.ATTR_FOOTER_HEIGHT);
 
     HtmlStyleMap bodyStyle = (HtmlStyleMap) data.getAttributes().get(TobagoConstants.ATTR_STYLE_BODY);
+    HtmlRendererUtil.replaceStyleAttribute(data, TobagoConstants.ATTR_STYLE_BODY, "height", (sheetHeight - footerHeight));
+
+
     List<Integer> columnWidths = (List<Integer>) data.getAttributes().get(TobagoConstants.ATTR_WIDTH_LIST);
-    Integer sheetHeight = HtmlRendererUtil.getStyleAttributeIntValue(sheetStyle, "height");
     writer.startElement(HtmlConstants.INPUT, null);
     writer.writeIdAttribute(sheetId + WIDTHS_POSTFIX);
     writer.writeNameAttribute(sheetId + WIDTHS_POSTFIX);

Modified: myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java?rev=740660&r1=740659&r2=740660&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java Wed Feb  4 09:08:59 2009
@@ -690,7 +690,7 @@
     return getConfiguredValue(facesContext, component, "scrollbarWidth");
   }
 
-  private void storeFooterHeight(FacesContext facesContext,
+  protected void storeFooterHeight(FacesContext facesContext,
       UIComponent component) {
     component.getAttributes().put(ATTR_FOOTER_HEIGHT,
         getFooterHeight(facesContext, component));