Solved

Problem in using showModelessDialog

Posted on 2003-11-23
6
657 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now