showModalDialog and TreeView problem

D

David

Hi all,

I am opening a webform with showModalDialog. This appears to pop-up fine,
though I have a problem...

Inside the webform is a treeview control.

When the treeview is populated, I am setting the treenode navigateurl to
javascript:Click('test')

This does not work. It opens a new window with javascript:Click('test') as
the address.

However, if I open the window with window.open, the javascript works fine.

Anyone any ideas on how I can get it to work?


Further notes...
I was trying to see if it was a general issue with JS, so I create an a href
tag with exactly the same javascript. This worked as expected, so it appears
to be a conflict with the treeview when inside a showModalDialog.

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
 
M

Mark Rae [MVP]

I am opening a webform with showModalDialog. This appears to pop-up fine,
though I have a problem...

Inside the webform is a treeview control.

When the treeview is populated, I am setting the treenode navigateurl to
javascript:Click('test')

This does not work. It opens a new window with javascript:Click('test') as
the address.

However, if I open the window with window.open, the javascript works fine.

Anyone any ideas on how I can get it to work?

Firstly, I would advise you not to use showModalDialog because it is
non-standard and available only in IE and Safari. There are much better
solutions available, especially if you are using AJAX...

However, if you must use showModalDialog, you could try putting

<base target="_self" />

in the <header> section of the page:
http://www.google.co.uk/search?sour...en-GBGB252GB252&q=showModalDialog+base+target
 
D

David

Mark Rae said:
Firstly, I would advise you not to use showModalDialog because it is
non-standard and available only in IE and Safari. There are much better
solutions available, especially if you are using AJAX...

However, if you must use showModalDialog, you could try putting

<base target="_self" />

in the <header> section of the page:
http://www.google.co.uk/search?sour...en-GBGB252GB252&q=showModalDialog+base+target

Hi Mark,

I have that, when I first found the problem, I searched and found the base
tag, so tried it. It doesn't work. :-(

(Something I also noted was that the showModalDialog appears to use cached
pages, I had to open the page in a normal window first before the
showModalDialog would accept the changed page)

I thought showModalDialog may not be standards compliant, but I did try it.
I will probably have to come up with another solution.

Have I actually found a bug? Can anyone confirm?
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
 
S

siccolo

You may also want to try use frame(s)...
i.e., let's say your main page is opener.aspx, and the page with
treeview is child.apsx. Then, create a new page child_frame.aspx, that
will host child.aspx in iframe element. From your main page,
opener.aspx, you need to open ShowModalDialog('child_frame.aspx')...

HTH,

.....more at Siccolo Articles http://www.siccolo.com/articles.asp
 
D

David

Thanks,

I may use this method as a treeview can get quite large and if I am keeping
the page the same size, a frame will help.

However, I have abandoned the showModalDialog for the time being and the
page is working fine using window.open. However, I need to somehow make the
page modal (not critical, but a nice to have... )

Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
 
S

siccolo

However, I have abandoned the showModalDialog for the time being and the
page is working fine using window.open. However, I need to somehow make the
page modal (not critical, but a nice to have... )

well, you can still use iframe element - but on/within the same page -
just set style.display to none when you need to hide iframe. Or you
can use <div> element and "host" tree view within div element, and set
style.display to none...

.... more at http://www.siccolo.com/articles.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top