You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2010/07/30 12:04:31 UTC
svn commit: r980715 - in /myfaces/tobago/branches/tobago-1.0.x:
example/test/src/main/webapp/tc/sheet/sheet-with-selectOne.xhtml
theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
Author: bommel
Date: Fri Jul 30 10:04:31 2010
New Revision: 980715
URL: http://svn.apache.org/viewvc?rev=980715&view=rev
Log:
TOBAGO-904) Problem with tc:selectOneChoice in sheet
Added:
myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/webapp/tc/sheet/sheet-with-selectOne.xhtml
Modified:
myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SheetRenderer.java
Added: myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/webapp/tc/sheet/sheet-with-selectOne.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/webapp/tc/sheet/sheet-with-selectOne.xhtml?rev=980715&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/webapp/tc/sheet/sheet-with-selectOne.xhtml (added)
+++ myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/webapp/tc/sheet/sheet-with-selectOne.xhtml Fri Jul 30 10:04:31 2010
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<f:view
+ xmlns:jsp="http://java.sun.com/JSP/Page"
+ xmlns:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:tx="http://myfaces.apache.org/tobago/extension"
+ xmlns:tcs="http://myfaces.apache.org/tobago/sandbox"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <tc:page width="600px" height="600px">
+
+ <tc:sheet value="#{sheet.localeList}" id="sheet" columns="fixed;*;*;*;*;*" var="entry" rows="1000"
+ showRowRange="left" showPageRange="right" showDirectLinks="center">
+ <tc:columnSelector disabled="#{entry.disabled}"/>
+ <tc:column label="Locale" id="l" sortable="true">
+ <tc:out value="#{entry.locale}"/>
+ </tc:column>
+ <tc:column label="Display Locale" id="d" sortable="true">
+ <tc:out value="#{entry.displayLocale}"/>
+ </tc:column>
+ <tc:column label="Country" id="c" sortable="true">
+ <tc:out value="#{entry.country}"/>
+ </tc:column>
+ <tc:column label="Language" id="a" sortable="true">
+ <tc:out value="#{entry.language}"/>
+ </tc:column>
+ <tc:column label="Select" >
+ <tc:selectOneChoice >
+ <f:selectItem itemValue="test" itemLabel="test"/>
+ </tc:selectOneChoice>
+ </tc:column>
+ </tc:sheet>
+
+ </tc:page>
+</f:view>
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=980715&r1=980714&r2=980715&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 Fri Jul 30 10:04:31 2010
@@ -34,6 +34,7 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.component.UIPage;
import org.apache.myfaces.tobago.component.UIReload;
import org.apache.myfaces.tobago.config.TobagoConfig;
+import org.apache.myfaces.tobago.context.ClientProperties;
import org.apache.myfaces.tobago.context.ResourceManager;
import org.apache.myfaces.tobago.context.ResourceManagerFactory;
import org.apache.myfaces.tobago.context.ResourceManagerUtil;
@@ -266,12 +267,7 @@ public class SheetRenderer extends Layou
HtmlStyleMap headerStyle = (HtmlStyleMap) attributes.get(ATTR_STYLE_HEADER);
if (headerStyle != null) {
- Integer zIndex = (Integer) facesContext.getExternalContext().getRequestMap().get(TobagoConstants.ATTR_ZINDEX);
- if (zIndex == null) {
- zIndex = 1;
- } else {
- zIndex = zIndex + 4;
- }
+ Integer zIndex = getZIndex(facesContext);
headerStyle.put("z-index", zIndex);
writer.writeStyleAttribute(headerStyle);
}
@@ -303,6 +299,21 @@ public class SheetRenderer extends Layou
writer.endElement(HtmlConstants.DIV);
writer.endElement(HtmlConstants.DIV);
+ if (ClientProperties.getInstance(facesContext).getUserAgent().isMsie()) {
+ writer.startElement(HtmlConstants.IFRAME, null);
+ writer.writeIdAttribute(sheetId + "_header_div" + SUBCOMPONENT_SEP + HtmlConstants.IFRAME);
+ writer.writeClassAttribute("tobago-sheet-header-iframe");
+ final StringBuilder iFrameStyle = new StringBuilder();
+ Integer zIndex = getZIndex(facesContext);
+ iFrameStyle.append("z-index: ");
+ iFrameStyle.append(zIndex + 2);
+ iFrameStyle.append("; ");
+ iFrameStyle.append(headerStyle);
+ writer.writeAttribute(HtmlAttributes.STYLE, iFrameStyle.toString(), false);
+ writer.writeAttribute(HtmlAttributes.SRC, ResourceManagerUtil.getBlankPage(facesContext), false);
+ writer.writeAttribute(HtmlAttributes.FRAMEBORDER, "0", false);
+ writer.endElement(HtmlConstants.IFRAME);
+ }
// end rendering header
}
@@ -470,6 +481,17 @@ public class SheetRenderer extends Layou
renderFooter(facesContext, data, writer, sheetId, sheetHeight, footerHeight, bodyStyle);
}
+ private Integer getZIndex(FacesContext facesContext) {
+ Integer zIndex = (Integer) facesContext.getExternalContext().getRequestMap().get(TobagoConstants.ATTR_ZINDEX);
+ if (zIndex == null) {
+ zIndex = 1;
+ } else {
+ zIndex = zIndex + 4;
+ }
+ facesContext.getExternalContext().getRequestMap().put(TobagoConstants.ATTR_ZINDEX, zIndex);
+ return zIndex;
+ }
+
protected void renderFooter(FacesContext facesContext, UIData data, TobagoResponseWriter writer,
String sheetId, Integer sheetHeight, int footerHeight, HtmlStyleMap bodyStyle) throws IOException {
final String showRowRange