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 2006/08/02 09:50:04 UTC

svn commit: r427927 - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/ core/src/main/java/org/apache/myfaces/tobago/component/ core/src/main/java/org/apache/myfaces/tobago/taglib/component/ core/src/main/java/org/apache/myfaces/t...

Author: bommel
Date: Wed Aug  2 00:50:03 2006
New Revision: 427927

URL: http://svn.apache.org/viewvc?rev=427927&view=rev
Log:
TOBAGO-108

Added:
    myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/model/Salutation.java
    myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/model/SalutationConverter.java
Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyCheckboxTagDeclaration.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneChoiceTagDeclaration.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneRadioTagDeclaration.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasConverter.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuRadioExtensionTag.java
    myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/TobagoDemoController.java
    myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/overview/OverviewController.java
    myfaces/tobago/trunk/example/demo/src/main/webapp/WEB-INF/faces-config.xml
    myfaces/tobago/trunk/example/demo/src/main/webapp/overview/basicControls.jsp
    myfaces/tobago/trunk/example/demo/src/main/webapp/overview/layout.jsp
    myfaces/tobago/trunk/example/demo/src/main/webapp/overview/toolbar.jsp
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java?rev=427927&r1=427926&r2=427927&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java Wed Aug  2 00:50:03 2006
@@ -35,6 +35,7 @@
   public static final String ATTR_CLASSES_BLOCKS = "cssClassesBlocks";
   public static final String ATTR_CLIENT_PROPERTIES = "clientProperties";
   public static final String ATTR_COLUMNS = "columns";
+  public static final String ATTR_CONVERTER = "converter";
   public static final String ATTR_DATE_STYLE = "dateStyle";
   public static final String ATTR_DEFAULT_COMMAND = "defaultCommand";
   public static final String ATTR_DIRECT_LINK_COUNT = "directLinkCount";

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java?rev=427927&r1=427926&r2=427927&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java Wed Aug  2 00:50:03 2006
@@ -27,6 +27,7 @@
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ACTION_ONCLICK;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ALIGN;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_CREATE_SPAN;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_CONVERTER;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ESCAPE;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_FOR;
@@ -832,12 +833,18 @@
     }
   }
 
-  public static void setConverter(UIComponent component, String converter) {
+  public static void setConverter(UIComponent component, String converterId) {
     ValueHolder valueHolder = (ValueHolder) component;
-    if (converter != null && valueHolder.getConverter() == null) {
-      valueHolder.setConverter(
-          FacesContext.getCurrentInstance().getApplication().createConverter(
-              converter));
+    if (converterId != null && valueHolder.getConverter() == null) {
+      final FacesContext facesContext = FacesContext.getCurrentInstance();
+      final Application application = facesContext.getApplication();
+      if (UIComponentTag.isValueReference(converterId)) {
+        ValueBinding valueBinding = application.createValueBinding(converterId);
+        component.setValueBinding(ATTR_CONVERTER, valueBinding);
+      } else {
+        Converter converter = application.createConverter(converterId);
+        valueHolder.setConverter(converter);
+      }
     }
   }
 

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyCheckboxTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyCheckboxTagDeclaration.java?rev=427927&r1=427926&r2=427927&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyCheckboxTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectManyCheckboxTagDeclaration.java Wed Aug  2 00:50:03 2006
@@ -25,6 +25,7 @@
 import org.apache.myfaces.tobago.taglib.decl.IsDisabled;
 import org.apache.myfaces.tobago.taglib.decl.IsInline;
 import org.apache.myfaces.tobago.taglib.decl.IsRendered;
+import org.apache.myfaces.tobago.taglib.decl.HasConverter;
 
 /*
  * Created: Aug 5, 2005 5:54:37 PM
@@ -42,6 +43,6 @@
     rendererType = "SelectManyCheckbox")
 public interface SelectManyCheckboxTagDeclaration extends
     SelectManyTagDeclaration, IsDisabled, HasId,
-    IsInline, HasRenderRange, IsRendered, HasBinding {
+    IsInline, HasRenderRange, IsRendered, HasBinding, HasConverter {
 
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneChoiceTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneChoiceTagDeclaration.java?rev=427927&r1=427926&r2=427927&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneChoiceTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneChoiceTagDeclaration.java Wed Aug  2 00:50:03 2006
@@ -29,6 +29,7 @@
 import org.apache.myfaces.tobago.taglib.decl.IsInline;
 import org.apache.myfaces.tobago.taglib.decl.IsReadonly;
 import org.apache.myfaces.tobago.taglib.decl.IsRendered;
+import org.apache.myfaces.tobago.taglib.decl.HasConverter;
 
 /*
  * Created: Aug 5, 2005 6:05:28 PM
@@ -47,7 +48,7 @@
 public interface SelectOneChoiceTagDeclaration
     extends SelectOneTagDeclaration, HasId, IsDisabled,
     IsReadonly, IsInline, HasLabelAndAccessKey,
-    IsRendered, HasBinding, HasTip {
+    IsRendered, HasConverter, HasBinding, HasTip {
 
   /**
    * Flag indicating that selecting an Item representing a value is required.

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneRadioTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneRadioTagDeclaration.java?rev=427927&r1=427926&r2=427927&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneRadioTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectOneRadioTagDeclaration.java Wed Aug  2 00:50:03 2006
@@ -27,6 +27,7 @@
 import org.apache.myfaces.tobago.taglib.decl.IsDisabled;
 import org.apache.myfaces.tobago.taglib.decl.IsInline;
 import org.apache.myfaces.tobago.taglib.decl.IsRendered;
+import org.apache.myfaces.tobago.taglib.decl.HasConverter;
 
 /*
  * Created: Aug 5, 2005 6:11:03 PM
@@ -42,7 +43,7 @@
     uiComponent = "org.apache.myfaces.tobago.component.UISelectOne",
     rendererType = "SelectOneRadio")
 public interface SelectOneRadioTagDeclaration extends SelectOneTagDeclaration, IsDisabled, HasId,
-    IsInline, HasRenderRange, IsRendered, HasBinding {
+    IsInline, HasRenderRange, IsRendered, HasBinding, HasConverter {
 
   /**
    * Flag indicating that selecting an Item representing a Value is Required.

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasConverter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasConverter.java?rev=427927&r1=427926&r2=427927&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasConverter.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/decl/HasConverter.java Wed Aug  2 00:50:03 2006
@@ -27,7 +27,13 @@
  */
 public interface HasConverter {
   /**
-   *  ConverterId of a registered converter.
+   * An expression that specifies the Converter for this component.
+   * If the value binding expression is a String,
+   * the String is used as an ID to look up a Converter.
+   * If the value binding expression is a Converter,
+   * uses that instance as the converter.
+   * The value can either be a static value (ID case only)
+   * or an EL expression.
    */
   @TagAttribute @UIComponentTagAttribute(expression = DynamicExpression.NONE)
   void setConverter(String converter);

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuRadioExtensionTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuRadioExtensionTag.java?rev=427927&r1=427926&r2=427927&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuRadioExtensionTag.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/MenuRadioExtensionTag.java Wed Aug  2 00:50:03 2006
@@ -25,6 +25,7 @@
 import org.apache.myfaces.tobago.taglib.decl.IsDisabled;
 import org.apache.myfaces.tobago.taglib.decl.HasValue;
 import org.apache.myfaces.tobago.taglib.decl.IsImmediateCommand;
+import org.apache.myfaces.tobago.taglib.decl.HasConverter;
 
 import javax.faces.webapp.FacetTag;
 import javax.servlet.jsp.JspException;
@@ -45,7 +46,7 @@
 
 @Tag(name = "menuRadio", tagExtraInfoClassName = "org.apache.myfaces.tobago.taglib.component.CommandTagExtraInfo")
 public class MenuRadioExtensionTag extends BodyTagSupport implements CommandTagDeclaration,
-    HasIdBindingAndRendered, HasLabel, IsDisabled, HasValue, IsImmediateCommand {
+    HasIdBindingAndRendered, HasLabel, IsDisabled, HasValue, IsImmediateCommand, HasConverter {
 
   private String rendered;
   private String value;
@@ -61,6 +62,7 @@
   private String binding;
   private String label;
   private String immediate;
+  private String converter;
 
   @Override
   public int doStartTag() throws JspException {
@@ -107,6 +109,9 @@
     selectOneRadio = new SelectOneRadioTag();
     selectOneRadio.setPageContext(pageContext);
     selectOneRadio.setParent(facetTag);
+    if (converter != null) {
+      selectOneRadio.setConverter(converter);
+    }
     if (value != null) {
       selectOneRadio.setValue(value);
     }
@@ -164,6 +169,10 @@
     this.immediate = immediate;
   }
 
+  public void setConverter(String converter) {
+    this.converter = converter;
+  }
+
   public void release() {
     super.release();
     rendered = null;
@@ -176,6 +185,7 @@
     binding = null;
     label = null;
     immediate = null;
+    converter = null;
   }
 
 }

Modified: myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/TobagoDemoController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/TobagoDemoController.java?rev=427927&r1=427926&r2=427927&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/TobagoDemoController.java (original)
+++ myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/TobagoDemoController.java Wed Aug  2 00:50:03 2006
@@ -204,7 +204,7 @@
   }
 
   public TabChangeListener getTabChangeListener() {
-    System.err.println("getTabChangeListener " + tabChangeListener);
+    LOG.error("getTabChangeListener " + tabChangeListener);
     return tabChangeListener;
   }
 

Added: myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/model/Salutation.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/model/Salutation.java?rev=427927&view=auto
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/model/Salutation.java (added)
+++ myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/model/Salutation.java Wed Aug  2 00:50:03 2006
@@ -0,0 +1,50 @@
+package org.apache.myfaces.tobago.example.demo.model;
+/*
+ * Copyright 2002-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: 27.07.2006
+ * Time: 21:21:12
+  */
+public enum Salutation {
+
+  UNKNOWN("basic_itemUnknown"),
+
+  MR("basic_itemMr"),
+
+  MRS("basic_itemMrs");
+
+  private String key;
+
+  Salutation(String key) {
+    this.key = key;
+  }
+
+  public String getKey() {
+    return key;
+  }
+
+  public static Salutation getSalutation(String key) {
+    for(Salutation salutation:values()) {
+      if (salutation.getKey().equals(key)) {
+        return salutation;
+      }
+    }
+    return null;
+  }
+}

Added: myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/model/SalutationConverter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/model/SalutationConverter.java?rev=427927&view=auto
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/model/SalutationConverter.java (added)
+++ myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/model/SalutationConverter.java Wed Aug  2 00:50:03 2006
@@ -0,0 +1,42 @@
+package org.apache.myfaces.tobago.example.demo.model;
+
+/*
+ * Copyright 2002-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.context.FacesContext;
+import javax.faces.component.UIComponent;
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: 01.08.2006
+ * Time: 20:04:26
+ */
+public class SalutationConverter implements Converter {
+
+  public Object getAsObject(FacesContext context, UIComponent component, String value) throws ConverterException {
+    return Salutation.getSalutation(value);
+  }
+
+  public String getAsString(FacesContext context, UIComponent component, Object value) throws ConverterException {
+    if (value instanceof Salutation) {
+      return ((Salutation)value).getKey();
+    }
+    return "";
+  }
+}

Modified: myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/overview/OverviewController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/overview/OverviewController.java?rev=427927&r1=427926&r2=427927&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/overview/OverviewController.java (original)
+++ myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/demo/overview/OverviewController.java Wed Aug  2 00:50:03 2006
@@ -16,11 +16,6 @@
  * limitations under the License.
  */
 
-/*
- * Created 19.05.2004 18:47:47.
- * $Id: OverviewController.java 1269 2005-08-08 20:20:19 +0200 (Mo, 08 Aug 2005) lofwyr $
- */
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.tobago.component.UIData;
@@ -28,6 +23,7 @@
 import org.apache.myfaces.tobago.context.ResourceManagerFactory;
 import org.apache.myfaces.tobago.event.SortActionEvent;
 import org.apache.myfaces.tobago.example.demo.model.solar.SolarObject;
+import org.apache.myfaces.tobago.example.demo.model.Salutation;
 import org.apache.myfaces.tobago.model.SheetState;
 import org.apache.myfaces.tobago.taglib.component.ToolBarTag;
 
@@ -43,16 +39,15 @@
 import java.util.Date;
 import java.util.List;
 
+/*
+ * Created 19.05.2004 18:47:47.
+ * $Id: OverviewController.java 1269 2005-08-08 20:20:19 +0200 (Mo, 08 Aug 2005) lofwyr $
+ */
+
 public class OverviewController {
 
   private static final Log LOG = LogFactory.getLog(OverviewController.class);
 
-  private static final String[] ITEM_KEYS = {
-    "basic_itemUnknown",
-    "basic_itemMr",
-    "basic_itemMrs",
-  };
-
   private static final String[] TREE_SELECT_MODE_KEYS = {
     "none",
     "single",
@@ -67,11 +62,11 @@
     "siblingLeafOnly"
   };
 
-  private String radioValue;
+  private Salutation radioValue;
 
-  private String singleValue;
+  private Salutation singleValue;
 
-  private String[] multiValue;
+  private Salutation[] multiValue;
 
   private String basicInput = "";
 
@@ -91,21 +86,21 @@
 
   private SheetConfig sheetConfig;
 
-    private String toolbarIconSize;
+  private String toolbarIconSize;
 
-    private SelectItem[] toolbarIconItems;
+  private SelectItem[] toolbarIconItems;
 
-    private String toolbarTextPosition;
+  private String toolbarTextPosition;
 
-    private SelectItem[] toolbarTextItems;
+  private SelectItem[] toolbarTextItems;
 
 
   public OverviewController() {
-    radioValue = ITEM_KEYS[0];
-    singleValue = ITEM_KEYS[0];
+    radioValue = Salutation.UNKNOWN;
+    singleValue = Salutation.UNKNOWN;
     treeSelectMode = TREE_SELECT_MODE_KEYS[0];
     treeListboxSelectMode = TREELISTBOX_SELECT_MODE_KEYS[0];
-    multiValue = new String[0];
+    multiValue = new Salutation[0];
     treeTabsState = 0;
     sheetConfig = new SheetConfig();
     String[] toolbarIconKeys
@@ -125,6 +120,21 @@
     toolbarTextPosition = ToolBarTag.LABEL_BOTTOM;
   }
 
+  private static SelectItem[] getSalutationSelectItems(ResourceManager resourceManager, String resource) {
+    Salutation[] salutations = Salutation.values();
+    SelectItem[] items = new SelectItem[salutations.length];
+    for (int i = 0; i < items.length; i++) {
+      String label = resourceManager.getProperty(
+          FacesContext.getCurrentInstance().getViewRoot(), resource, salutations[i].getKey());
+      LOG.info("label = " + label + "");
+      if (label == null) {
+        label = salutations[i].getKey();
+      }
+      items[i] = new SelectItem(salutations[i], label);
+    }
+    return items;
+  }
+
   private static SelectItem[] getSelectItems(
       String[] keys, ResourceManager resourceManager, String resource) {
     SelectItem[] items = new SelectItem[keys.length];
@@ -232,7 +242,7 @@
   public SelectItem[] getItems() {
     ResourceManager resourceManager = ResourceManagerFactory
         .getResourceManager(FacesContext.getCurrentInstance());
-    return getSelectItems(ITEM_KEYS, resourceManager, "overview");
+    return getSalutationSelectItems(resourceManager, "overview");
   }
 
   public SelectItem[] getItems2() {
@@ -257,27 +267,27 @@
 
   }
 
-  public String getRadioValue() {
+  public Salutation getRadioValue() {
     return radioValue;
   }
 
-  public void setRadioValue(String radioValue) {
+  public void setRadioValue(Salutation radioValue) {
     this.radioValue = radioValue;
   }
 
-  public String getSingleValue() {
+  public Salutation getSingleValue() {
     return singleValue;
   }
 
-  public void setSingleValue(String singleValue) {
+  public void setSingleValue(Salutation singleValue) {
     this.singleValue = singleValue;
   }
 
-  public String[] getMultiValue() {
+  public Salutation[] getMultiValue() {
     return multiValue;
   }
 
-  public void setMultiValue(String[] multiValue) {
+  public void setMultiValue(Salutation[] multiValue) {
     this.multiValue = multiValue;
   }
 

Modified: myfaces/tobago/trunk/example/demo/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/demo/src/main/webapp/WEB-INF/faces-config.xml?rev=427927&r1=427926&r2=427927&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/tobago/trunk/example/demo/src/main/webapp/WEB-INF/faces-config.xml Wed Aug  2 00:50:03 2006
@@ -36,6 +36,11 @@
     </locale-config>
   </application>
 
+  <converter>
+    <converter-id>salutationId</converter-id>
+    <converter-class>org.apache.myfaces.tobago.example.demo.model.SalutationConverter</converter-class>
+  </converter>
+
   <managed-bean>
     <managed-bean-name>demo</managed-bean-name>
     <managed-bean-class>org.apache.myfaces.tobago.example.demo.TobagoDemoController</managed-bean-class>

Modified: myfaces/tobago/trunk/example/demo/src/main/webapp/overview/basicControls.jsp
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/demo/src/main/webapp/overview/basicControls.jsp?rev=427927&r1=427926&r2=427927&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/webapp/overview/basicControls.jsp (original)
+++ myfaces/tobago/trunk/example/demo/src/main/webapp/overview/basicControls.jsp Wed Aug  2 00:50:03 2006
@@ -42,7 +42,7 @@
               label="#{overviewBundle.basic_textboxLabel}" tip="test"
               suggestMethod="#{overviewController.getInputSuggestItems}" />
           <tx:date value="#{overviewController.basicDate}"
-              label="#{overviewBundle.basic_dateLabel}">
+              label="#{overviewBundle.basic_dateLabel}" required="true" >
             <f:convertDateTime pattern="dd.MM.yyyy" />
           </tx:date>
           <tx:time label="#{overviewBundle.basic_timeLabel}"
@@ -64,7 +64,8 @@
         <f:facet name="layout">
           <tc:gridLayout columns="1*;1*"  border="0"/>
         </f:facet>
-        <tc:selectOneRadio value="#{overviewController.radioValue}" id="rg0">
+        <tc:selectOneRadio value="#{overviewController.radioValue}"
+                           id="rg0" converter="salutationId">
           <f:selectItems value="#{overviewController.items}" id="items0" />
         </tc:selectOneRadio>
 
@@ -72,10 +73,12 @@
           <f:facet name="layout">
             <tc:gridLayout rows="fixed;fixed"/>
           </f:facet>
-          <tc:selectManyCheckbox value="#{overviewController.multiValue}" id="cbg0" renderRange="1-2">
+          <tc:selectManyCheckbox value="#{overviewController.multiValue}" 
+                                 id="cbg0" renderRange="1-2" converter="salutationId">
             <f:selectItems value="#{overviewController.items}" id="itemsg0" />
           </tc:selectManyCheckbox>
-          <tc:selectOneChoice value="#{overviewController.singleValue}">
+          <tc:selectOneChoice value="#{overviewController.singleValue}"
+              converter="salutationId" >
             <f:selectItems value="#{overviewController.items}" />
           </tc:selectOneChoice>
         </tc:panel>

Modified: myfaces/tobago/trunk/example/demo/src/main/webapp/overview/layout.jsp
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/demo/src/main/webapp/overview/layout.jsp?rev=427927&r1=427926&r2=427927&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/webapp/overview/layout.jsp (original)
+++ myfaces/tobago/trunk/example/demo/src/main/webapp/overview/layout.jsp Wed Aug  2 00:50:03 2006
@@ -32,7 +32,8 @@
           <tc:gridLayout columns="1*;1*" rows="fixed;fixed;fixed;fixed;fixed;*"/>
         </f:facet>
         <tx:selectOneChoice value="#{overviewController.singleValue}"
-                           label="#{overviewBundle.layout_salutation}">
+                            label="#{overviewBundle.layout_salutation}"
+                            converter="salutationId" >
           <f:selectItems value="#{overviewController.items}" />
         </tx:selectOneChoice>
         <tc:cell/>

Modified: myfaces/tobago/trunk/example/demo/src/main/webapp/overview/toolbar.jsp
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/demo/src/main/webapp/overview/toolbar.jsp?rev=427927&r1=427926&r2=427927&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/webapp/overview/toolbar.jsp (original)
+++ myfaces/tobago/trunk/example/demo/src/main/webapp/overview/toolbar.jsp Wed Aug  2 00:50:03 2006
@@ -185,7 +185,7 @@
 
             <tc:menu label="#{overviewBundle.toolbar_selectSingleselect}">
 
-              <tx:menuRadio value="#{overviewController.radioValue}" >
+              <tx:menuRadio value="#{overviewController.radioValue}" converter="salutationId" >
                 <f:selectItems value="#{overviewController.items}" />
               </tx:menuRadio>
 

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java?rev=427927&r1=427926&r2=427927&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectOneChoiceRenderer.java Wed Aug  2 00:50:03 2006
@@ -41,10 +41,8 @@
 
 public class SelectOneChoiceRenderer extends SelectOneRendererBase {
 
-
   private static final Log LOG = LogFactory.getLog(SelectOneChoiceRenderer.class);
 
-
   public boolean getRendersChildren() {
     return true;
   }
@@ -62,8 +60,6 @@
         || ComponentUtil.getBooleanAttribute(component, ATTR_DISABLED)
         || ComponentUtil.getBooleanAttribute(component, ATTR_READONLY);
 
-
-
     writer.startElement("select", component);
     writer.writeNameAttribute(component.getClientId(facesContext));
     writer.writeIdAttribute(component.getClientId(facesContext));
@@ -90,22 +86,11 @@
       writer.endElement("option");
     }
     writer.endElement("select");
-
-
-
   }
 
   public int getComponentExtraWidth(FacesContext facesContext, UIComponent component) {
     int space = 0;
-
-//    if (component.getFacet(FACET_LABEL) != null) {
-//      int labelWidht = LayoutUtil.getLabelWidth(component);
-//      space += labelWidht != 0 ? labelWidht : getLabelWidth(facesContext, component);
-//      space += getConfiguredValue(facesContext, component, "labelSpace");
-//    }
-
     return space;
   }
-
 }