Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Action and javascript

 
Perindevi Peramur
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have one submit button A and one ordinary button B. On clicking B, control is transfered to javascript as below. But it says file not found. But it works fine, if its not a pop up window and goes into regular jsp and displays info.

Thanks for any help

function popUp(field, mytest) {
var printList ="31~21";
var url = '/misc/comSelectionSave.do?printButton=Create Proof&printList='+printList;
var pop = window.open(url, 'Create Proof', 'height=550,width=800,scrollbars=yes,resizable=yes');
pop.focus();
document.forms[0].submit();
}

Why is the struts action not recognized here ?

If I use rewrite, then I am not able to pass the parameter printList.
var pop = window.open("<html:rewrite action="/misc/comSelectionSave?printButton=Create Proof"/>","Create Proof", "toolbar=0,scrollbars=0,status=1,resizable=0,menubar=0,width=400,height=500");
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem may be that you have a space in one of your parameters. You also have a space in the window name, which is not allowed.

Change:

var url = '/misc/comSelectionSave.do?printButton=Create Proof&printList='+printList;

to

var url = '/misc/comSelectionSave.do?printButton=Create+Proof&printList='+printList;

and

var pop = window.open(url, 'Create Proof', 'height=550,width=800,scrollbars=yes,resizable=yes');

to

var pop = window.open(url, 'Create_Proof', 'height=550,width=800,scrollbars=yes,resizable=yes');
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic