Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

opening new window

 
sachin pachpute
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have developed one form which on submition opens a new window and displaying anather jsp page successfully. I created a war file and deployed on the test server but same form is not working on it. Newly opened window is not able to find a jsp page and is giving 404 error.

my java script code is as follows,
var sName ='UPDATE_PROJECT';
var oParentWindow =window;
var iWidth =750;
var iHeight =400;
var scroll =0;

var xPos = oParentWindow.screen.width / 2 - iWidth / 2;
var yPos = oParentWindow.screen.height / 2 - iHeight / 2;

var sFeatures = 'width='+ iWidth + ',' + 'height=' + iHeight + ',';
sFeatures += 'left='+ xPos + ',' + 'top=' + yPos;
sFeatures += ',scrollbars=' + (scroll == 0 ? '0' : '1');

var oDialog = oParentWindow.open('', sName, sFeatures, false);
if ( oDialog )
{
oDialog.document.writeln(
'<html><head><title>Console</title></head><body>'
+'<Form action="/campaign/updateArticle.do">'
+'<input type="hidden" name="campaignNumbersInput" value="'+document.getElementById("campaignNumbersInput").value+'">'
+'<input type="hidden" name="projectType" value="'+document.getElementById("projectType").value+'">'
+'</Form></body></html>')

oDialog.document.forms[0].submit();
}

Please help,
Thanks in advance.
Sachin.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



Eric
 
sachin pachpute
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,

I am a bit confused. Could you elaborate on it please.

My concern is same code is working on local machine. but when i deplyed it's war file on test server, pop-up window is not able to find jsp page.

Thanks for help.
Sachin.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no clue what you mean that it can not find the jsp. What JSP? The form location where it is submitting? why are you using JavaScript to write this form?

Why don't you just use a get url (querystring), no form needed. Why don;t you use ajax instead. No pop up needed.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic