Solved

Struts : How to open a action in new window

Posted on 2004-04-12
7
1,665 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Link to post behind image slider 1 52
Form submit issue 11 80
Stupid git question 2 63
app server have enough resources... 2 24
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now