Forum Discussion
Hello,
You can temporarily store the value of this inside of another variable before you open your dialog. This should allow you to access it inside of your callback after the dialog returns.
// Store the value of the context item
var self = this;
wnd.ArasModules.Dialog.show('iframe', param).promise.then(callback);
After this, you can access the context item in your callback through the variable you've defined instead of this.
function callback(res) {
if (res) {
var id_1 = res[0];
var id_2 = res[1];
self.setProperty("MyProperty", id_1);
self.apply();
}
}
As an additional note, you almost never need to define a new Innovator object inside of a Method. From a client-side method, you can access an Innovator object from most contexts by using aras.IomInnovator. This admittedly shouldn't have any impact on functionality, but it's slightly more memory efficient to reference the existing object.
Chris
Christopher Gillis
Aras Labs Software Engineer