You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@click.apache.org by sa...@apache.org on 2009/05/17 20:43:28 UTC

svn commit: r775737 - /incubator/click/trunk/click/extras/src/org/apache/click/extras/prototype/CalendarField.java

Author: sabob
Date: Sun May 17 18:43:28 2009
New Revision: 775737

URL: http://svn.apache.org/viewvc?rev=775737&view=rev
Log:
render Calendar markup in separate method for easier customization

Modified:
    incubator/click/trunk/click/extras/src/org/apache/click/extras/prototype/CalendarField.java

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/prototype/CalendarField.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/prototype/CalendarField.java?rev=775737&r1=775736&r2=775737&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/prototype/CalendarField.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/prototype/CalendarField.java Sun May 17 18:43:28 2009
@@ -352,6 +352,21 @@
         }
 
         super.render(buffer);
+        renderCalendar(buffer);
+
+        if (help != null) {
+            buffer.append(help);
+        }
+    }
+
+    // ------------------------------------------------------ Protected Methods
+
+    /**
+     * Render the calendar HTML representation to the buffer.
+     *
+     * @param buffer the buffer to render the calendar HTML representation to
+     */
+    protected void renderCalendar(HtmlStringBuffer buffer) {
 
         if (!isReadonly() && !isDisabled()) {
             Context context = getContext();
@@ -373,14 +388,8 @@
             buffer.appendAttribute("title", calendarTitle);
             buffer.elementEnd();
         }
-
-        if (help != null) {
-            buffer.append(help);
-        }
     }
 
-    // ------------------------------------------------------ Protected Methods
-
     /**
      * Add the calendar options as a script to the list of head elements.
      * <p/>