Hi Yongyan Chen,
Nice work developing a pluggable widget!
When you call the setValue method on a MendixObject, it's updated value is stored in the browser's state. If you press Ctrl-Alt-G while having the Console open in your browser, it gives a dump of the state, and it should also contain your updated MendixObject.
If you want to persist it to the database, you can commit the object by calling the commit() function, this will trigger network activity:
mx.data.commit({
mxobj: obj,
callback: function() {
console.log("Object committed");
},
error: function(e) {
console.error("Could not commit object:", e);
}
});
If you just want to use the changed object in a microflow, that's also possible, then just pass it along as parameter.
Good luck!
Kind regards,
Johan Flikweert