Solved

Struts : How to open a action in new window

Posted on 2004-04-12
7
1,657 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

705 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

20 Experts available now in Live!

Get 1:1 Help Now