You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by an...@apache.org on 2008/02/04 16:35:30 UTC
svn commit: r618306 -
/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/MultiValueEditorWithSuggestion.js
Author: antonio
Date: Mon Feb 4 07:35:29 2008
New Revision: 618306
URL: http://svn.apache.org/viewvc?rev=618306&view=rev
Log:
Add onchange event handler. Avoid IE7 to show null in case there is no selected value in the suggestion list.
Modified:
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/MultiValueEditorWithSuggestion.js
Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/MultiValueEditorWithSuggestion.js
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/MultiValueEditorWithSuggestion.js?rev=618306&r1=618305&r2=618306&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/MultiValueEditorWithSuggestion.js (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/resources/org/apache/cocoon/forms/resources/js/MultiValueEditorWithSuggestion.js Mon Feb 4 07:35:29 2008
@@ -31,6 +31,8 @@
},
// properties and methods
{
+ onchange: "",
+ name: "",
widgetsInTemplate: true,
cformsIdPrefix: "id-prefix-not-set",
dataUrl: "_cocoon/forms/suggest",
@@ -57,13 +59,13 @@
}
dataUrl += "filter=%{searchString}";
}
- this.dataUrl = dataUrl;
+ this.dataUrl = dataUrl;
},
_addOnSubmitHandler: function(parent) {
var form = this._getForm(this);
if (form != null) {
- dojo.event.connect("before", form,"onsubmit", this, "_selectAll");
+ dojo.event.connect("before", form,"onsubmit", this, "_selectAll");
} else {
dojo.debug("MultiValueEditorWithSuggestion is not being added to a form -- no onSubmitHandler then.");
}
@@ -87,7 +89,7 @@
var text = td.nextSibling != null ? dojo.dom.textContent(td.nextSibling) : value;
if (value && text) {
- this.select.addOption(value, text);
+ this.select.addOption(value, text);
}
tr = dojo.dom.nextElement(tr, "tr");
}
@@ -105,8 +107,8 @@
this.select.addOption(this.entry.comboBoxSelectionValue.value, this.entry.comboBoxValue.value);
}
dojo.event.browser.stopEvent(event);
- this.entry.setValue(null);
- this.entry.setSelectedValue(null);
+ this.entry.setValue("");
+ this.entry.setSelectedValue("");
break;
}
},
@@ -129,7 +131,7 @@
}
if (!alreadyInList) {
- this.options[this.options.length] = new Option(text, value, true, true);
+ this.options[this.options.length] = new Option(text, value, true, true);
}
}
@@ -150,7 +152,7 @@
dojo.event.connect(this, "addedTo", this, "_addOnSubmitHandler");
this._readData(this.getFragNodeRef(frag));
- },
+ },
openPopup: function() {
if (!this.popupWindow) {
@@ -171,7 +173,7 @@
this.popupWindow.showPopup(this.linkButton.id);
}
}
-);
+);
function __showPopup(anchorname) {
this.getXYPosition(anchorname);