File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Facing problem on close of a popup which i opened using the action class. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Facing problem on close of a popup which i opened using the action class." Watch "Facing problem on close of a popup which i opened using the action class." New topic
Author

Facing problem on close of a popup which i opened using the action class.

hrishikesh deodhar
Greenhorn

Joined: Feb 27, 2007
Posts: 11
OK, Here is the situation..

I need to create a popup on click of a link.. and display some data on that poppedup jsp...

Now, here is what i did..
I created a hyperlink on the existing page.. looks something like this...
<a href="" on click="displayPopup();">Display FLevel data</a>
now.. on click of this link, the javascrip function opens a window using

window.showModalDialog("DisplayFLevel.do","","Page");

using this...
i call the action class DisplayFLevel.do and fetch the data i want to show it on the jsp and forward it to a jsp...
i am using tiles..
now once i close the poppedup jsp.. the parent window gets submitted to the context root of the web application.. and i have no idea why it is doing that...
Nick Williamson
Ranch Hand

Joined: Jan 06, 2007
Posts: 73
it's because you're ...href=""..., if you're going to us the a tag and not need a url in the href attribute, having ...href="#"... normally takes care of that

just put a # and at worst it'll shoot you to the top of the page. If you need it to stay a the scroll level you're at create an anchor



and then in the href attribute of the link put ...href="#anchorname"...
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
What if you changed your code to the following?



- Brent
[ May 15, 2007: Message edited by: Brent Sterling ]
Nick Williamson
Ranch Hand

Joined: Jan 06, 2007
Posts: 73
I've had issues in some browsers with javascript inside the href, but it will work on some, but not all, it's safer using the onclick event.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Facing problem on close of a popup which i opened using the action class.