myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bom...@apache.org
Subject svn commit: r399798 - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/renderkit/ theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/
Date Thu, 04 May 2006 18:09:45 GMT
Author: bommel
Date: Thu May  4 11:09:43 2006
New Revision: 399798

URL: http://svn.apache.org/viewcvs?rev=399798&view=rev
Log:
TOBAGO-59
TOBAGO-60

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DateRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TimeRenderer.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java?rev=399798&r1=399797&r2=399798&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java
(original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/renderkit/RendererBase.java
Thu May  4 11:09:43 2006
@@ -320,7 +320,7 @@
   public Converter getConverter(FacesContext context, UIComponent component) {
     Converter converter = null;
     if (component instanceof ValueHolder) {
-      converter = ((ValueHolder)component).getConverter();
+      converter = ((ValueHolder) component).getConverter();
     }
     if (converter == null) {
       ValueBinding valueBinding = component.getValueBinding("value");

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DateRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DateRenderer.java?rev=399798&r1=399797&r2=399798&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DateRenderer.java
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/DateRenderer.java
Thu May  4 11:09:43 2006
@@ -98,6 +98,19 @@
     input.getAttributes().put(ATTR_STYLE_CLASS, classes);
     super.renderMain(facesContext, input, writer);
 
+    Converter converter = getConverter(facesContext, input);
+    if (converter instanceof DateTimeConverter) {
+      String pattern = ((DateTimeConverter) converter).getPattern();
+      if (pattern != null) {
+        String id = input.getClientId(facesContext);
+        writer.startElement("input", input);
+        writer.writeAttribute("type", "hidden", null);
+        writer.writeIdAttribute(id + ":converterPattern");
+        writer.writeAttribute("value", pattern, null);
+        writer.endElement("input");
+      }
+    }
+
     UIComponent picker = input.getFacet(FACET_PICKER);
     if (picker == null) {
       picker = createPicker(input);
@@ -121,9 +134,12 @@
     DatePickerController datePickerController = new DatePickerController();
 
     String converterPattern = "yyyy-MM-dd"; // from calendar.js  initCalendarParse
-    final Converter converter = ((UIOutput) component).getConverter();
+    final Converter converter = getConverter(facesContext, component);
     if (converter instanceof DateTimeConverter) {
       converterPattern = ((DateTimeConverter) converter).getPattern();
+    } else {
+      LOG.warn("Converter for DateRenderer is not instance of DateTimeConverter. Using default
Pattern "
+          + converterPattern);
     }
 
     // create link

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java?rev=399798&r1=399797&r2=399798&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/FileRenderer.java
Thu May  4 11:09:43 2006
@@ -38,7 +38,6 @@
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIInput;
 import javax.faces.context.FacesContext;
-import javax.faces.convert.ConverterException;
 import javax.servlet.ServletRequest;
 import javax.servlet.http.HttpServletRequestWrapper;
 import java.io.IOException;
@@ -98,12 +97,6 @@
     }
     input.setSubmittedValue(item);
     input.setValid(true);
-  }
-
-  public Object getConvertedValue(
-      FacesContext context, UIComponent component, Object submittedValue)
-      throws ConverterException {
-    return submittedValue;
   }
 
   public void encodeEndTobago(

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java?rev=399798&r1=399797&r2=399798&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/InRenderer.java
Thu May  4 11:09:43 2006
@@ -43,8 +43,6 @@
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIInput;
 import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.convert.DateTimeConverter;
 import javax.faces.el.MethodBinding;
 import java.io.IOException;
 import java.util.Iterator;
@@ -113,21 +111,6 @@
 //      writer.writeAttribute("onchange", onchange, null);
     }
     writer.endElement("input");
-
-    if (input.getConverter() != null) {
-      Converter converter = input.getConverter();
-      if (converter instanceof DateTimeConverter) {
-        String pattern
-            = ((DateTimeConverter) converter).getPattern();
-        if (pattern != null) {
-          writer.startElement("input", input);
-          writer.writeAttribute("type", "hidden", null);
-          writer.writeIdAttribute(id + ":converterPattern");
-          writer.writeAttribute("value", pattern, null);
-          writer.endElement("input");
-        }
-      }
-    }
 
     // input suggest
     if (renderAjaxSuggest) {

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java?rev=399798&r1=399797&r2=399798&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/SelectBooleanCheckboxRenderer.java
Thu May  4 11:09:43 2006
@@ -33,7 +33,6 @@
 import javax.faces.component.UIInput;
 import javax.faces.component.UISelectBoolean;
 import javax.faces.context.FacesContext;
-import javax.faces.convert.ConverterException;
 import java.io.IOException;
 
 public class SelectBooleanCheckboxRenderer extends RendererBase {
@@ -56,18 +55,7 @@
       uiInput.setSubmittedValue(Boolean.FALSE);
     }
   }
-
-  public Object getConvertedValue(FacesContext facesContext,
-            UIComponent component, Object submittedValue)
-            throws ConverterException {
-    // TODO move this to RendererBase
-    if (submittedValue instanceof Boolean) {
-      return submittedValue;
-    } else {
-      return super.getConvertedValue(facesContext, component, submittedValue);
-    }
-  }
-
+  
   public void encodeEndTobago(FacesContext facesContext,
       UIComponent uiComponent) throws IOException {
 

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TimeRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TimeRenderer.java?rev=399798&r1=399797&r2=399798&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TimeRenderer.java
(original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TimeRenderer.java
Thu May  4 11:09:43 2006
@@ -72,8 +72,9 @@
       title = stringBuffer.toString();
     }
 
-    title = HtmlRendererUtil.addTip(
-            title, (String) input.getAttributes().get(ATTR_TIP));
+    // TODO title??
+    title =
+        HtmlRendererUtil.addTip(title, (String) input.getAttributes().get(ATTR_TIP));
 
     String currentValue = getCurrentValue(facesContext, input);
     if (LOG.isDebugEnabled()) {
@@ -95,8 +96,6 @@
     }
 
     boolean hasSeconds = converterPattern.indexOf('s') > -1;
-
-    SimpleDateFormat dateFormat = new SimpleDateFormat(converterPattern);
 
     Object value = input.getValue();
     Date date;



Mime
View raw message