Solved

Problem in using showModelessDialog

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…
Suggested Courses

636 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