Solved

Problem in using showModelessDialog

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JavaScript export function not working in IE 15 49
Removing HTML elements using javascript 4 42
Passport Expiry 3 44
How can i  prevent default  Submision? 6 24
Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
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…

815 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

11 Experts available now in Live!

Get 1:1 Help Now