• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

iframe and struts url won't work

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, i'm using iframe which targeting to a pop up window which intended to be a child of a main window.
However,the main window always redirect back to the child everytime i close the child window, my colleagues said that it because of the action url from struts being targeted in iframe.

This is the source

 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suspect that the problem is with the fact that you're using showModalDialog to open the window instead of window.open(). One of the quirks of showModalDialog is that you cannot submit a form from a window opened by this command and have the response return to the same window. The showModalDialog was intended to elicit a brief response and then close itself, returning the response to the main window. It was not intended for form submission.

In order to solve this problem, you have 2 choices: Use AJAX to get what you need from the server instead of a form submission or use window.open() to open the window instead of showModalDialog.

In my opinion, you're walking on dangerous ground by using showModalDialog anyway because it is not a cross-browser solution. One generally cannot assume that all clients to a website will be using Internet Explorer.
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Merrill said its not advisable to use Modal Dialog when your application is intended to be used on different browser. But if you sure your application would be viewed only in IE then there is an work around for your problem.

Try doing this,

window.name = "AnyName"
document.someForm.action="someaction.do";
document.someForm.method="post";
document.someForm.target="AnyName";
document.someForm.submit();

So the response would come to the same popup window.

Hope this helps.

Thanks and Regards,
Arul.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic