aspose file tools*
The moose likes Struts and the fly likes modal dialog in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "modal dialog in struts" Watch "modal dialog in struts" New topic
Author

modal dialog in struts

partha chaudhuri
Greenhorn

Joined: Sep 21, 2004
Posts: 27
In my STRUT application i have a jsp page (abc.jsp) which shows the summary of a category of product.
I am opening a second jsp (xyz.jsp) by window.showModalDialog which shows product details.
In the xyz.jsp if i add something and submit, it is opening up a new window.
But my application requires that after submit, we can get back to the modal window( here xyz.jsp)

How can i do this?
Thanks,
Partha
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
My recommendation is to use window.open() instead. See this thread for a more extensive discussion of this topic.
[ May 25, 2006: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
partha chaudhuri
Greenhorn

Joined: Sep 21, 2004
Posts: 27
But when I am using window.open(), in the new open window I lost the seesion, as well as I need that this window will be always top.
Thanks,
Partha
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Partha,

I use window.open() extensively in my applications, and it never causes the user to lose a session. In this case, I'm writing only for Microsoft Internet Explorer with no other browsers supported, and using WebSphere V 5.1 as an application server. I'd be interested to know what environment you're using that causes you to lose a session when you pop up a window using window.open().

I understand the desire to have the popup window always on top, but I haven't had a big problem with my users hiding the window or ignoring it and working on the main window.

The main problem with using a modal dialog is the one you're encountering: When you submit the form, it will not go back to the same window, but open up a new one. The only way around this seems to be to use Dom Lassy's suggestion in the other thread (see the link in my previous post), which is to use an <IFRAME> inside your modal dialog, and specify the name of the iframe as the target of the form action.
Mani Venkata Kanth
Ranch Hand

Joined: Aug 21, 2006
Posts: 39
Hi,

But using window.open() opens a new browser.. if parent window is closed it wont be closed, which will create issue.

is it not possible with modal window??

Thanks in advance
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

I prefer to use JavaScript dialogs over browser window dialogs. Have a look at the JQuery Struts2 Plugin's Dialog Tag.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
wood burning stoves
 
subject: modal dialog in struts