myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmarinsc...@apache.org
Subject svn commit: r294836 - /myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlRendererUtils.java
Date Tue, 04 Oct 2005 17:11:28 GMT
Author: mmarinschek
Date: Tue Oct  4 10:11:23 2005
New Revision: 294836

URL: http://svn.apache.org/viewcvs?rev=294836&view=rev
Log:
fix for MYFACES-662

Modified:
    myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlRendererUtils.java

Modified: myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlRendererUtils.java
URL: http://svn.apache.org/viewcvs/myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlRendererUtils.java?rev=294836&r1=294835&r2=294836&view=diff
==============================================================================
--- myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlRendererUtils.java
(original)
+++ myfaces/share/trunk/src/java/org/apache/myfaces/renderkit/html/HtmlRendererUtils.java
Tue Oct  4 10:11:23 2005
@@ -587,36 +587,51 @@
     {
         ResponseWriter writer = facesContext.getResponseWriter();
 
-        List selectItemList;
-        Converter converter;
-        boolean isSelectOne;
+        List selectItemList=null;
+        Converter converter=null;
+        boolean isSelectOne=false;
         if (uiComponent instanceof UISelectMany) {
         	isSelectOne = false;
             selectItemList = RendererUtils
                     .getSelectItemList((UISelectMany) uiComponent);
             converter = findUISelectManyConverterFailsafe(facesContext, uiComponent);
-        } else {
+        } else if(uiComponent instanceof UISelectOne){
         	isSelectOne = true;
             selectItemList = RendererUtils
                     .getSelectItemList((UISelectOne) uiComponent);
             converter = findUIOutputConverterFailSafe(facesContext, uiComponent);
         }
 
-        writer.startElement(isSelectOne ? HTML.SPAN_ELEM : HTML.UL_ELEM, uiComponent);
-        writeIdIfNecessary(writer, uiComponent, facesContext);
+        if(uiComponent instanceof UISelectBoolean)
+        {
+            converter = findUIOutputConverterFailSafe(facesContext, uiComponent);
+
+            writer.startElement(HTML.SPAN_ELEM, uiComponent);
+            writeIdIfNecessary(writer, uiComponent, facesContext);
+            renderDisplayValueOnlyAttributes(uiComponent, writer);
+            writer.writeText(RendererUtils.getConvertedStringValue(facesContext,uiComponent,
+                        converter,((UISelectBoolean) uiComponent).getValue()),JSFAttr.VALUE_ATTR);
+            writer.endElement(HTML.SPAN_ELEM);
 
-        renderDisplayValueOnlyAttributes(uiComponent, writer);
+        }
+        else
+        {
+            writer.startElement(isSelectOne ? HTML.SPAN_ELEM : HTML.UL_ELEM, uiComponent);
+            writeIdIfNecessary(writer, uiComponent, facesContext);
 
-        Set lookupSet = getSubmittedOrSelectedValuesAsSet(
-                uiComponent instanceof UISelectMany,
-                uiComponent, facesContext, converter);
+            renderDisplayValueOnlyAttributes(uiComponent, writer);
 
-        renderSelectOptionsAsText(facesContext, uiComponent, converter, lookupSet,
-                selectItemList, isSelectOne);
+            Set lookupSet = getSubmittedOrSelectedValuesAsSet(
+                    uiComponent instanceof UISelectMany,
+                    uiComponent, facesContext, converter);
 
-        // bug #970747: force separate end tag
-        writer.writeText("", null);
-        writer.endElement(isSelectOne ? HTML.SPAN_ELEM : HTML.UL_ELEM);
+            renderSelectOptionsAsText(facesContext, uiComponent, converter, lookupSet,
+                    selectItemList, isSelectOne);
+
+            // bug #970747: force separate end tag
+            writer.writeText("", null);
+            writer.endElement(isSelectOne ? HTML.SPAN_ELEM : HTML.UL_ELEM);
+        }
 
     }
 



Mime
View raw message