Solved

Struts : How to open a action in new window

Posted on 2004-04-12
7
1,677 Views
Last Modified: 2012-05-04
Hi

When i submit my form  depends on action i have to open a new window,  How can i take care this in Action Class

0
Comment
Question by:LakshmanaRavula
  • 2
  • 2
  • 2
7 Comments
 
LVL 1

Assisted Solution

by:Paulio
Paulio earned 200 total points
ID: 10807277
<script>
function make_target(form_ref){
  var target_win = window.open('', 'newwin', 'width=400,height=400');
  form_ref.target = target_win;
}
</script>
<form action="" onSubmit="make_target(this)">
  <input blabla>
</form>

hope it helps!
0
 

Author Comment

by:LakshmanaRavula
ID: 10807326
Hi

I haqve tried using this option But Result coming into parent window and new window coming with no data
0
 

Author Comment

by:LakshmanaRavula
ID: 10807337

On Parent window i have 6 actions,  out of 6 one of the action should print report on new window so iam calling a javascript that contins new window for that Submit button  

New window coming with blank and report coming on parent window`
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 1

Assisted Solution

by:Paulio
Paulio earned 200 total points
ID: 10808216
Oops...

The correct code to submit a form in a new (popup) window should have been:

<script>
function make_target(form_ref){
  window.open('', 'newwin', 'width=400,height=400');
  form_ref.target = 'newwin';
}
</script>
<form action="somepage.cgi" onSubmit="make_target(this)">
  <input type=text name=test value="" size=20>
  <input type=submit>
</form>

If you are actually looking for another solution, could you please post the relevant code?
0
 
LVL 30

Accepted Solution

by:
third earned 100 total points
ID: 10809777

<form action="somepage.cgi" targer="_new">
0
 
LVL 30

Expert Comment

by:third
ID: 10809778
err, "targer" should be "target"
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read about why website design really matters in today's demanding market.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question