You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2009/11/10 10:13:14 UTC

svn commit: r834394 - in /myfaces/tobago/trunk: example/test/src/main/webapp/tc/selectOneListbox/ theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/ theme/scarborough/src/main/resources/org/apache/myfaces...

Author: lofwyr
Date: Tue Nov 10 09:13:06 2009
New Revision: 834394

URL: http://svn.apache.org/viewvc?rev=834394&view=rev
Log:
TOBAGO-821: SelectOneListbox with new layout
 - also fixing error style

Added:
    myfaces/tobago/trunk/example/test/src/main/webapp/tc/selectOneListbox/
    myfaces/tobago/trunk/example/test/src/main/webapp/tc/selectOneListbox/selectOneListbox.xhtml
Modified:
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
    myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
    myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
    myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css

Added: myfaces/tobago/trunk/example/test/src/main/webapp/tc/selectOneListbox/selectOneListbox.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/webapp/tc/selectOneListbox/selectOneListbox.xhtml?rev=834394&view=auto
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/webapp/tc/selectOneListbox/selectOneListbox.xhtml (added)
+++ myfaces/tobago/trunk/example/test/src/main/webapp/tc/selectOneListbox/selectOneListbox.xhtml Tue Nov 10 09:13:06 2009
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<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:ui="http://java.sun.com/jsf/facelets"
+    xmlns:f="http://java.sun.com/jsf/core">
+
+  <tc:page>
+    <tc:gridLayoutConstraint width="700px" height="600px"/>
+    <f:facet name="layout">
+      <!-- fixme: rows="20px" -->
+      <tc:gridLayout columns="*;2*" rows="auto;20px;*;*;*;*;*;auto" columnSpacing="30px"/>
+    </f:facet>
+
+    <tc:messages>
+      <tc:gridLayoutConstraint columnSpan="2"/>
+    </tc:messages>
+    
+    <tc:label value="tc"/>
+    <tc:label value="tx"/>
+    
+    <tc:selectOneListbox value="a">
+      <tc:selectItem itemValue="a" itemLabel="A Value"/>
+      <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
+    </tc:selectOneListbox>
+    <tx:selectOneListbox value="b" label="normal">
+      <tc:selectItem itemValue="a" itemLabel="A Value"/>
+      <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
+    </tx:selectOneListbox>
+
+    <tc:selectOneListbox value="a" readonly="true">
+      <tc:selectItem itemValue="a" itemLabel="A Value"/>
+      <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
+    </tc:selectOneListbox>
+    <tx:selectOneListbox value="b" readonly="true" label="readonly">
+      <tc:selectItem itemValue="a" itemLabel="A Value"/>
+      <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
+    </tx:selectOneListbox>
+
+    <tc:selectOneListbox value="a" disabled="true">
+      <tc:selectItem itemValue="a" itemLabel="A Value"/>
+      <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
+    </tc:selectOneListbox>
+    <tx:selectOneListbox value="b" disabled="true" label="disabled">
+      <tc:selectItem itemValue="a" itemLabel="A Value"/>
+      <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
+    </tx:selectOneListbox>
+
+    <tc:selectOneListbox value="a" tip="tip">
+      <tc:selectItem itemValue="a" itemLabel="A Value"/>
+      <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
+    </tc:selectOneListbox>
+    <tx:selectOneListbox value="b" tip="tip" label="tip">
+      <tc:selectItem itemValue="a" itemLabel="A Value"/>
+      <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
+    </tx:selectOneListbox>
+
+    <tc:selectOneListbox required="true">
+      <tc:selectItem itemValue="a" itemLabel="A Value"/>
+      <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
+    </tc:selectOneListbox>
+    <tx:selectOneListbox required="true" label="required">
+      <tc:selectItem itemValue="a" itemLabel="A Value"/>
+      <tc:selectItem itemValue="b" itemLabel="An Alternative"/>
+    </tx:selectOneListbox>
+    
+    <tc:button label="submit"/>
+    
+  </tc:page>
+</f:view>

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java?rev=834394&r1=834393&r2=834394&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneListboxRenderer.java Tue Nov 10 09:13:06 2009
@@ -51,42 +51,43 @@
 
   public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
     if (!(component instanceof UISelectOneListbox)) {
-      LOG.error("Wrong type: Need " + UISelectOneListbox.class.getName() + ", but was "
-          + component.getClass().getName());
+      LOG.error("Wrong type: Need " + UISelectOneListbox.class.getName()
+          + ", but was " + component.getClass().getName());
       return;
     }
 
+    UISelectOneListbox select = (UISelectOneListbox) component;
     TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
-    UISelectOneListbox selectOne = (UISelectOneListbox) component;
-    List<SelectItem> items = RenderUtil.getSelectItems(selectOne);
 
-    writer.startElement(HtmlConstants.SELECT, selectOne);
-    String clientId = selectOne.getClientId(facesContext);
-    writer.writeNameAttribute(clientId);
-    writer.writeIdAttribute(clientId);
-    writer.writeAttribute(HtmlAttributes.DISABLED, ComponentUtils.getBooleanAttribute(selectOne, Attributes.DISABLED));
-    Integer tabIndex = selectOne.getTabIndex();
+    String id = select.getClientId(facesContext);
+    List<SelectItem> items = RenderUtil.getSelectItems(select);
+
+    writer.startElement(HtmlConstants.SELECT, select);
+    writer.writeNameAttribute(id);
+    writer.writeIdAttribute(id);
+    writer.writeAttribute(HtmlAttributes.DISABLED, ComponentUtils.getBooleanAttribute(select, Attributes.DISABLED));
+    Integer tabIndex = select.getTabIndex();
     if (tabIndex != null) {
       writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
     }
-    Style style = new Style(facesContext, selectOne);
+    Style style = new Style(facesContext, select);
     writer.writeStyleAttribute(style);
     writer.writeClassAttribute();
-    HtmlRendererUtils.renderTip(selectOne, writer);
+    HtmlRendererUtils.renderTip(select, writer);
     writer.writeAttribute(HtmlAttributes.SIZE, 2); // should be greater 1
-    if (!ComponentUtils.getBooleanAttribute(selectOne, Attributes.REQUIRED)) {
+    if (!ComponentUtils.getBooleanAttribute(select, Attributes.REQUIRED)) {
       writer.writeAttribute(HtmlAttributes.ONCHANGE, "Tobago.selectOneListboxChange(this)", false);
       writer.writeAttribute(HtmlAttributes.ONCLICK, "Tobago.selectOneListboxClick(this)", false);
     }
 
-    Object[] values = {selectOne.getValue()};
+    Object[] values = {select.getValue()};
 
-    HtmlRendererUtils.renderSelectItems(selectOne, items, values, writer, facesContext);
+    HtmlRendererUtils.renderSelectItems(select, items, values, writer, facesContext);
 
     writer.endElement(HtmlConstants.SELECT);
-    super.encodeEnd(facesContext, selectOne);
-    HtmlRendererUtils.renderFocusId(facesContext, selectOne);
-    HtmlRendererUtils.checkForCommandFacet(selectOne, facesContext, writer);
+    super.encodeEnd(facesContext, select);
+    HtmlRendererUtils.renderFocusId(facesContext, select);
+    HtmlRendererUtils.checkForCommandFacet(select, facesContext, writer);
   }
 
 

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties?rev=834394&r1=834393&r2=834394&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties Tue Nov 10 09:13:06 2009
@@ -124,6 +124,8 @@
 
 SelectOneChoice.preferredHeight=25
 
+SelectOneListbox.minimumHeight=25
+
 SelectOneRadio.height=20
 
 Separator.preferredHeight=14

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css?rev=834394&r1=834393&r2=834394&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css Tue Nov 10 09:13:06 2009
@@ -505,9 +505,10 @@
   background-color: #bbccdd;
 }
 
-/*.tobago-selectOneListbox-error {
-	border: 1px solid #ff0000;
-}*/
+.tobago-selectOneListbox-error {
+  border-style: solid;
+  border-color: #ff0000;
+}
 
 /* selectOneRadio ---------------------------------------------------------- */
 

Modified: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties?rev=834394&r1=834393&r2=834394&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties Tue Nov 10 09:13:06 2009
@@ -71,6 +71,8 @@
 
 SelectBooleanCheckbox.height=19
 
+SelectOneListbox.minimumHeight=20
+
 Separator.preferredHeight=14
 
 Sheet.ascendingMarkerWidth=15

Modified: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css?rev=834394&r1=834393&r2=834394&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/style/style.css Tue Nov 10 09:13:06 2009
@@ -598,8 +598,7 @@
 /* selectOneListbox -------------------------------------------------------- */
 
 .tobago-selectOneListbox-default  {
-  font: 12px arial, helvetica, sans-serif;
-  color: #000000;
+  font-size: 12px;
 }
 
 .tobago-selectOneListbox-disabled {