Announcement Announcement Module
No announcement yet.
How to submit to a new window ? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to submit to a new window ?

    Hi all,

    I have a page (call it page A) where the user enters some report options (filters, sorting options, etc), and then submits this form to display a PDF report (call it page B). B opens in a new window. How I've done this is, in page A :

    <form method="post" target="_blank">

    and A.onSubmit() has :

    return new ModelAndView(new RedirectView(getSuccessView()));

    The problem of course is that if there are binding/validation errors when A is submitted - then it still opens a new window and redisplays A with the errors.

    How can I make A open B in a new window but only after A has successfully finished binding and validation ?

    Thanks in advance !

  • #2
    one way I can think of is, always come back to page A after the submission is processed, the view code for page A can check to see if there are any errors, if not, render a couple of lines of javascript code that opens a new window (would be B).


    • #3
      Thanks for the suggestion - I'd actually tried that, but to my serious disappointment this only worked in Mozilla/Firefox and not in IE. The report (PDF) just was not displaying when i used Javascript's



      • #4
        This is obviously out of Spring's scope and I'm not a javascript person, but I just tried this out and it works on both FF and IE (they would get blocked by the blocker in either browser, but that's a different issue):
        	<script type="text/javascript">;"http&#58;//", "abc"&#41;;