click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r958847 - in /click/trunk/click/extras/src/org/apache/click/extras/control: AutoCompleteTextField.java CheckList.java DateField.java Menu.java VirtualKeyboard.java
Date Tue, 29 Jun 2010 06:59:04 GMT
Author: sabob
Date: Tue Jun 29 06:59:03 2010
New Revision: 958847

URL: http://svn.apache.org/viewvc?rev=958847&view=rev
Log:
use consistent id name convention. Also dropped dateField 'c_' prefix as its inconsistent
with rest of framework and unlikely to clash.

Modified:
    click/trunk/click/extras/src/org/apache/click/extras/control/AutoCompleteTextField.java
    click/trunk/click/extras/src/org/apache/click/extras/control/CheckList.java
    click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java
    click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java
    click/trunk/click/extras/src/org/apache/click/extras/control/VirtualKeyboard.java

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/AutoCompleteTextField.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/AutoCompleteTextField.java?rev=958847&r1=958846&r2=958847&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/AutoCompleteTextField.java
(original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/AutoCompleteTextField.java
Tue Jun 29 06:59:03 2010
@@ -300,7 +300,7 @@ public abstract class AutoCompleteTextFi
 
         String fieldId = getId();
         JsScript script = new JsScript();
-        script.setId(fieldId + "_autocomplete");
+        script.setId(fieldId + "-autocomplete");
         if (!headElements.contains(script)) {
             // Script must be executed as soon as browser dom is ready
             script.setExecuteOnDomReady(true);
@@ -309,7 +309,7 @@ public abstract class AutoCompleteTextFi
             HtmlStringBuffer buffer = new HtmlStringBuffer(150);
             buffer.append("new Ajax.Autocompleter(");
             buffer.append("'").append(fieldId).append("'");
-            buffer.append(",'").append(fieldId).append("_auto_complete_div'");
+            buffer.append(",'").append(fieldId).append("-auto-complete-div'");
             buffer.append(",'").append(contextPath).append(page.getPath()).append(
                 "'");
             buffer.append(",").append(getAutoCompleteOptions()).append(");");
@@ -332,7 +332,7 @@ public abstract class AutoCompleteTextFi
 
         buffer.elementStart("div");
         buffer.appendAttribute("class", "auto_complete");
-        buffer.appendAttribute("id", getId() + "_auto_complete_div");
+        buffer.appendAttribute("id", getId() + "-auto-complete-div");
         buffer.closeTag();
         buffer.elementEnd("div");
     }

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/CheckList.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/CheckList.java?rev=958847&r1=958846&r2=958847&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/CheckList.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/CheckList.java Tue Jun 29
06:59:03 2010
@@ -682,7 +682,7 @@ public class CheckList extends Field {
 
         String checkListId = getId();
         JsScript script = new JsScript();
-        script.setId(checkListId + "_js_setup");
+        script.setId(checkListId + "-js-setup");
 
         if (!headElements.contains(script)) {
             script.setExecuteOnDomReady(true);
@@ -696,7 +696,7 @@ public class CheckList extends Field {
                 // Script to execute
                 buffer.append("Sortable.create('");
                 buffer.append(StringEscapeUtils.escapeJavaScript(checkListId));
-                buffer.append("_ul'");
+                buffer.append("-ul'");
 
                 if (getHeight() != null) {
                     buffer.append(", { scroll : '");
@@ -708,7 +708,7 @@ public class CheckList extends Field {
             } else {
                 buffer.append("initChecklist('");
                 buffer.append(StringEscapeUtils.escapeJavaScript(checkListId));
-                buffer.append("_ul');\n");
+                buffer.append("-ul');\n");
             }
             script.setContent(buffer.toString());
             headElements.add(script);
@@ -1040,7 +1040,7 @@ public class CheckList extends Field {
 
         // the ul tag
         buffer.elementStart("ul");
-        buffer.appendAttribute("id", getId() + "_ul");
+        buffer.append(" id=\"").append(getId()).append("-ul\"");
         buffer.closeTag();
 
         // the options
@@ -1050,7 +1050,6 @@ public class CheckList extends Field {
             for (Iterator it = optionsList.iterator(); it.hasNext();) {
                 Option option = (Option) it.next();
                 i++;
-                final String liId = getName() + "_" + i;
 
                 buffer.append("<li>");
                 if (sortable) {
@@ -1058,14 +1057,14 @@ public class CheckList extends Field {
                     buffer.appendAttribute("style", "cursor:move;");
                 } else {
                     buffer.elementStart("label");
-                    buffer.appendAttribute("for", liId);
+                    buffer.append(" for=\"").append(getName()).append('_').append(i).append("\"");
                 }
                 buffer.appendAttribute("class", "checkListLabel");
                 buffer.closeTag();
 
                 buffer.append("<input type=\"checkbox\" ");
                 buffer.appendAttributeEscaped("value", option.getValue());
-                buffer.appendAttribute("id", liId);
+                buffer.append(" id=\"").append(getName()).append('_').append(i).append("\"");
                 buffer.appendAttribute("name", getName());
 
                 if (sortable) {

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java?rev=958847&r1=958846&r2=958847&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java Tue Jun 29
06:59:03 2010
@@ -856,7 +856,7 @@ public class DateField extends TextField
         String fieldId = getId();
 
         JsScript script = new JsScript();
-        script.setId(fieldId + "_js_setup");
+        script.setId(fieldId + "-js-setup");
 
         // Note the Calendar options script is recreated and checked if it
         // is contained in the headElement. This caters for when the field is
@@ -890,7 +890,7 @@ public class DateField extends TextField
      */
     protected void addCalenderTranslations(List<Element> headElements) {
         JsScript script = new JsScript();
-        script.setId("c_datefield_js_setup_global");
+        script.setId("datefield-js-setup-global");
         if (!headElements.contains(script)) {
             DateFormatSymbols dfs = new DateFormatSymbols(getLocale());
 

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java?rev=958847&r1=958846&r2=958847&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java Tue Jun 29 06:59:03
2010
@@ -1061,7 +1061,7 @@ public class Menu extends AbstractContro
         }
 
         JsScript script = new JsScript();
-        script.setId(id + "_js_setup");
+        script.setId(id + "-js-setup");
         if (!headElements.contains(script)) {
             // Script must be executed as soon as browser dom is ready
             script.setExecuteOnDomReady(true);

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/VirtualKeyboard.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/VirtualKeyboard.java?rev=958847&r1=958846&r2=958847&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/VirtualKeyboard.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/VirtualKeyboard.java Tue
Jun 29 06:59:03 2010
@@ -143,7 +143,7 @@ public class VirtualKeyboard extends Tex
 
         String fieldId = getId();
         JsScript script = new JsScript();
-        script.setId(fieldId + "_js_setup");
+        script.setId(fieldId + "-js-setup");
 
         if (!headElements.contains(script)) {
             HtmlStringBuffer buffer = new HtmlStringBuffer(150);



Mime
View raw message