here is a patch if you want it sooner, let me know if that helps
On 3/2/06, Jerry Smith <[EMAIL PROTECTED]
> wrote:
I'm using snapshot 20060227-0200 a ListMultipleChoice with AjaxFormComponentUpdatingBehavior. The ListMultipleChoice's model is getting set to only the first selected item in the list during the AJAX update. I'm guessing the problem might be in wicket-ajax.js:
function wicketGetValue(comp) {
var type=comp.type;
if (type=="checkbox"||type=="radio") {
return comp.checked;
} else {
return comp.value; ß for select will only return the first item
}
}
If it's just a _javascript_ fix, it would probably be faster for you guys to do it. If it's more involved, I'd be happy to get a patch together if you could start me down the right path of the possible classes involved.
### Eclipse Workspace Patch 1.0
#P wicket
Index: src/java/wicket/ajax/form/AjaxFormComponentUpdatingBehavior.java
===================================================================
RCS file:
/cvsroot/wicket/wicket/src/java/wicket/ajax/form/AjaxFormComponentUpdatingBehavior.java,v
retrieving revision 1.7
diff -u -r1.7 AjaxFormComponentUpdatingBehavior.java
--- src/java/wicket/ajax/form/AjaxFormComponentUpdatingBehavior.java 17 Feb
2006 18:32:20 -0000 1.7
+++ src/java/wicket/ajax/form/AjaxFormComponentUpdatingBehavior.java 2 Mar
2006 16:52:46 -0000
@@ -75,10 +75,7 @@
AppendingStringBuffer buff = new
AppendingStringBuffer(url.length() + 128);
buff.append("wicketAjaxGet('");
buff.append(url);
- buff.append("&");
- buff.append(fc.getInputName());
- buff.append("='+");
- buff.append("wicketGetValue(this));");
+ buff.append("&'+wicketSerialize(this))");
return buff.toString();
}
Index: src/java/wicket/ajax/wicket-ajax.js
===================================================================
RCS file: /cvsroot/wicket/wicket/src/java/wicket/ajax/wicket-ajax.js,v
retrieving revision 1.9
diff -u -r1.9 wicket-ajax.js
--- src/java/wicket/ajax/wicket-ajax.js 2 Mar 2006 07:59:34 -0000 1.9
+++ src/java/wicket/ajax/wicket-ajax.js 2 Mar 2006 16:52:45 -0000
@@ -5,14 +5,6 @@
function wicketHide(id) {
document.getElementById(id).style.display = "none";
}
-function wicketGetValue(comp) {
- var type = comp.type;
- if (type == "checkbox" || type == "radio") {
- return comp.checked;
- } else {
- return comp.value;
- }
-}
// AJAX FUNCTIONS
