Closed sameer678 closed 6 years ago
Hi, in your callback function you can make a call to Alert.getIFrameWindow() which returns the window object of your webresource. You can then access inputs etc from the webresource.
E.g.:
function CallbackFunction() {
var iFrameWindow = Alert.getIFrameWindow();
var value = iFrameWindow.document.getElementById("somefield").value;
}
Also note you can simplify your code a lot:
Alert.showWebResource(url, 800, 500, "", [new Alert.Button("Close", CallbackFunction)], null, true, 10);
Kind Regards, Paul
Thanks Paul for the quick response. I can access Web resource DOM elements. Is there any way we access HTML Web resource variables or methods? I want to return array from HTML to call back?
Sure, just set a global variable inside your web resource then access it using the get IFrame window method.
I am using below method to open HTML Web resource. Is there any way to return value to callback method from HTML?
var alertButton = new Alert.Button(); alertButton.label = "Close"; alertButton.callback = CallbackFunction; var array = new Array(); array.push(alertButton); Alert.showWebResource(url, 800, 500, "", array, null, true, 10);