Try this:
obj.set(attr, value);
obj.save({ callback : function () {}});
Also, check out http://apidocs.mendix.com/client/
Disclaimer: The apidocs are still a work in progress.
What is wrong here:
saveStaff: function() {
mx.processor.get("//Staff.Staff[name='Lukasek']", {}, dojo.hitch(this, function(obj) {
obj.set("test", "test");
obj.save({
callback: function() {
//i do not want to do anything just store ...
}
});
}));
},
Is it something missing?
Please help or i got a madness, regards, Lukas
Oki thanks, but how can i retrieve the obj at first?
Oki i have change signature, now i can get my object, but problem is with save:
saveStaff: function() {
mx.processor.get({
xpath: "//Staff.Staff[Name='Lukasek']",
callback: function(objs) {
if(objs.length == 0) {
alert('empty list');
} else {
for ( var int = 0; int < objs.length; int++) {
var obj = objs[int];
obj.setAttribute("Test", "it works");
mx.processor.save({
mxobj: obj,
callback: function() {
obj.commit();
}
}, this);
}
}
}
}, this);
}
From firebug konzole i get http://localhost:8084/xas/change but there is no change in DB. Can you help me?
Regards, Lukas