ROSDK JS - ROComplexType

Hi,

I am using ROComplexType to pass data from server to client and vice versa…

Server to Client OK!
Client to Server. NOT OK!

If I change RemObjectsSDK.js here:

RemObjects.SDK.ROStructType.prototype.toObject = function toObject() {

var result = {};
for (var prop in this) {
    if ((typeof this[prop]) != "function") {
        if (this[prop].value instanceof RemObjects.SDK.ROComplexType) {
            result[prop] = this[prop].value.toObject();
        } else
            result[prop] = this[prop].value;
    };
};
return result;

};

Just removing value (undefined) from: result[prop] = this[prop].value; … works fine.

ok ??

Thanks,
Willian.

I’m afraid, it’s not.
Every property of ROStructType object should be an object itself, holding datatype and value.
Like this:

function DataParameter() {
    this.Name = {dataType : "Utf8String", value : null};
    this.Value = {dataType : "Variant", value : null};
};

var p = new DataParameter();
p.Name.value = "id";
p.Value.value = 1000;

So, if value is undefined, there’s something wrong with the object.

Also there is an article at http://wiki.remobjects.com/wiki/Using_complex_types_(JavaScript)

Ooops… my mistake !!

I forgot “.value” when setting data! :frowning:

Thanks
Willian.