Write the below given code in browser script for an applet . This below given code will display Abort, Retry and Ignore prompt on click of a button.
In this example I had created a button on an applet and the name of the method it invokes upon click is EventMethodAddress. This code has been provided by Tejeshwar Singh a friend of mine
if (name == "EventMethodAddress")
{
var arr = new Object;
arr.prompt = "Are you sure?";
arr.buttons = 2;
arr.title = "Testing Dialog";
var intRet;
intRet = theApplication().ShowModalDialog("temp.htm", arr, "dialogHeight:150px; dialogLeft:200px; dialogWidth:500px; status:no;help:no;")
if(intRet == 3)
alert("You clicked Abort");
if(intRet == 4)
alert("You clicked Retry");
if(intRet == 5)
alert("You clicked Ignore");
return("CancelOperation");
}
Let’s go through the code now
we create a new object with var arr = new Object statement. This object will be used to pass input parameters to display information in prompt.
arr.prompt argument is used to pass the text to be displayed in the prompt.
arr.buttons argument will decide what buttons are to be displayed on prompt. Possible values are
1 = OK - CANCEL
2 = ABORT – RETRY - IGNORE
3 = YES – NO – CANCEL
4 = YES – NO
If you don’t pass this argument then by default a prompt with only OK button is displayed. In our example code we are passing 2 so that means abort, retry and cancel prompt is going to be displayed.
arr.title argument will be the title of the prompt.
ShowModalDialog function takes 3 input arguments
- Name of the HTML file which contains required HTML and Javascript code to display prompt as in our case it is temp.htm.
- Object containing input arguments
- CSS which determines the height and width of code. You can change this depending on the text you want to display
Bad news is that this thing doesn’t work in Siebel 7.8, it is a product defect :( but good news
is that a workaround is available to make it work. In next part we will discuss the workaround


(4 votes, average: 3.75 out of 5)
6 Comments at "Using ShowModalDialog"
Hi,
I’m having problem with Task UI. I need to pause/resume task from custom script. Google did not suggest anything. Please suggest some solution and also consider my post as an idea for next cool article.
Hi,
Any news about mentioned problem?
coudn’t get your question.
Which news you are talking about?
if you are talking about solution .. I already posted it in the final part of the series
Sorry didn’t read your earlier comment…
I haven’t worked on Siebel 8.0 so cannot help you much there… but hopefully will be starting soon… If I find anything I will let you know
thx neel and anyone who would like to help.
Hi,
Im having a question. I have used this ShowModalDialog method and also displayed as html.But, I need to copy the content displayed by showmodaldialog using Ctrl+C. How to achieve this.
Thanks in Advance,
Comment Now!