Binding of nested properties doesnt work.
See details here
http://www.nabble.com/support-for-nested-properties-tf1949563.html
------- Additional comments from sjivan Wed Jul 19 01:41:30 +0000 2006 -------
Created an attachment (id=9)
modified util.js file which carries out binding as outlined in Joe's email
------- Additional comments from sjivan Wed Jul 19 01:53:19 +0000 2006 -------
Created an attachment (id=10)
tests
------- Additional comments from sjivan Sun Dec 10 16:56:04 +0000 2006 -------
A bug was reported with the assignment of multiple select options
http://www.nabble.com/RE%3A--setValues-for-multiple-select---doesnt-work-anymore-tf2769099.html
Basically when trying to set multiple values of a select field via DWRUtil.setValues(selectField, ['option1', 'option3']), the call did not set the options 'option1' and 'option3'. However setting a single option by passing a non array single value like DWRUtil.setValues(selectField, 'option3') worked.
The issue was with with the check
if (map[property] != null && typeof map[property] == "object") {
in dwr.util._getDataProperties where a test was being made to see if the call is trying so set a nested property. The check typeof map[property] == "object" passes even when the property value is an array however for the nested property code to be invoked, the proerty value should be a data object and not an array as arrays apply to multi select fields.
The following fixes the issue.
dwr.util._isArray = function (o) {
return isObject(o) && o.constructor == Array;
}
dwr.util._isDataObject = function (o) {
return (o && typeof o == 'object');
}
dwr.util._getDataProperties = function(map, prefixes) {
for (var property in map) {
-- /*if (map[property] != null && typeof map[property] == "object") {*/
++ if (map[property] != null && dwr.util._isDataObject(map[property]) && !
dwr.util._isArray(map[property]) ) {
Attaching an updated test case which has multi selects.
------- Additional comments from sjivan Sun Dec 10 16:57:27 +0000 2006 -------
Created an attachment (id=13)
updated test case which has multi select binding
------- Additional comments from sjivan Sun Dec 10 17:01:38 +0000 2006 -------
Can an admin update the example on
http://getahead.ltd.uk/dwr/browser/util/setvalues
to include a multi select and also have the default value of the args to setValues include the multi select. eg :
{
div: "new div content",
password: "1234567890",
select: ['value two', 'value three']
}
It will also be nice if a sample of the nested proeprties (liek the one I attached) is made available online.
Was: https://dwr.dev.java.net/issues/show_bug.cgi?id=110