Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem in using showModelessDialog

Posted on 2003-11-23
6
Medium Priority
?
672 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 6

Accepted Solution

by:
ren_b earned 200 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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

721 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