PDA

View Full Version : UIWorkspace.Prompt not pausing execution



dot.Scott
14 Aug 2008, 6:56 AM
I am having trouble with the ws.Prompt as it is not pausing the script execution. I made the assumption that it should work something like alert? I want to wait until the user clicks OK before closing the tab.


...
txt += 'the link at the bottom of the email to return here and \n'
txt += 'complete the process'

if (isNewDoc) {
ws = new Ext.nd.UIWorkspace();
ws.Prompt('ok', 'New Doc', txt);

var panel = false;
try {
panel = parent.ExtndApp.ui.tabPanel.getActiveTab();
}
catch(e) {
// Do Nothing
};

if (panel) {
parent.ExtndApp.ui.tabPanel.remove(panel);
};

};

Am I doing something wrong?

Zakaroonikov
14 Aug 2008, 5:24 PM
I am having trouble with the ws.Prompt as it is not pausing the script execution. I made the assumption that it should work something like alert? I want to wait until the user clicks OK before closing the tab.


...
txt += 'the link at the bottom of the email to return here and \n'
txt += 'complete the process'

if (isNewDoc) {
ws = new Ext.nd.UIWorkspace();
ws.Prompt('ok', 'New Doc', txt);

var panel = false;
try {
panel = parent.ExtndApp.ui.tabPanel.getActiveTab();
}
catch(e) {
// Do Nothing
};

if (panel) {
parent.ExtndApp.ui.tabPanel.remove(panel);
};

};

Am I doing something wrong?

Maybe try something like:



ws.Prompt({
type : 'ok',
title : 'New Doc',
prompt : txt,
callback : function () {
var panel = false;
try {
panel = parent.ExtndApp.ui.tabPanel.getActiveTab();
}
catch(e) {
// Do Nothing
};

if (panel) {
parent.ExtndApp.ui.tabPanel.remove(panel);
};
}
});


The callback should be called on the ok click

dot.Scott
15 Aug 2008, 5:51 AM
Thanks! That worked. For some reason I thought the callback would be part of the function.

Thanks again.