Solved

Problem in using showModelessDialog

Posted on 2003-11-23
6
666 Views
Last Modified: 2007-12-19
Hi,
I have worked with showModelessDialog method of window object. I used it in the onclick event handler of a button as below to open myDialog.htm file:

     win=window.showModlessDialog(‘myDialog.htm’, window)

and I put a button on the myDialog page to show the URL of the first window when clicked as this:

     alert(dialogArguments.document.URL)

It worked fine. Then I wanted to show myDialog window through executing a context menu command. I added necessary changes to registry to insert a command to IE context menu and targeted it to a script containing this line of code:

     parentWin=external.menuArguments
     parentWin.showModelessDialog(‘myDialog.htm’, parentWin)

So far so good. myDialog window opened. I expected to be able to use dialogArguments again to do some changes in the window I clicked the right mouse button. But unexpectedly I understood that no parameter could be sent to myDialog window, in fact using every parameter that I passed to it was faced with an undefined error. Well, where the problem lies. How can I access the window I made a right click on in this way?

I hope I could express my problem clearly and I hope there is a solution to my problem.

Thanks,
Omid.
0
Comment
Question by:omid1407
  • 2
  • 2
6 Comments
 
LVL 6

Accepted Solution

by:
ren_b earned 50 total points
ID: 9808300
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/showmodelessdialog.asp has a lot of info on it...

but really, isn't a showmodelessdialog just a window that pops up with no attributes and throws variables to the main page?  its really a pointless function imo.

0
 
LVL 6

Expert Comment

by:ren_b
ID: 9808341
oh to answer you question i guess. the showmodelessdialog window is jsut a little dialog window, its not an actual html webpage so it doesn't behave like one. when you right click, it won't do anything. this thing only works in ie.  i dunno what you did to your registry, or why. why do you need to right click anywya?
0
 
LVL 3

Assisted Solution

by:makc
makc earned 50 total points
ID: 9812345
unless you use file: protocol, you can do something like

parentWin.showModelessDialog(‘http://server/myDialog.htm?any_string_here’, parentWin)

...and than parse any_string.

another freaky way to do this is to use about: protocol so you can supply html with already defined vars. like, try to copy and paste in IE address bar folowing url (that is whole line from about:... to ...on>) to see how it works:

about:<button onclick="alert('hi')">say hi</button>
0
 
LVL 3

Expert Comment

by:makc
ID: 9812365
note, however, that about: is very unreliable :( it could work fine on one PC and do not on another.
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10383621
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: ren_b {http:#9808300} & makc {http:#9812345}

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jAy
EE Cleanup Volunteer
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question