Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Securing DevOps this week in the Security forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem while opening new window  RSS feed

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i m facing problem at the time of opening a jsp in a new window.


Here is the code what i have coded.

part of javaScript
===========
function openw
{
window.open ("jsp/contactinfo.jsp", "contactinfo","width=850,height=370,status=no,
resizable=no,top=100,left=100,scrollbars=yes");
return false;
}

part of JSP
======

"<" html:image property="btnAddContactInfo" page="/img/add.gif" alt="add" border="0" onclick "javascript:return openw ;"<"

part of FORM
==========

Public String getBtnAddContactInfo method
{
setAction("addContactAction");
return btnAddContactInfo;
}

public void setAction(String action)
{
this.action = action;
}

part of ACTION
=========

String sAction= employerForm.getAction();


i m getting null, when i click on EDIT button in JSP, new window is opening but in action i m getting sAction as a null.

i hope u all are clear with my propblem, i think it's something because of new window, because when i remove the opew javascript call, then i m getting sAction = "addContactAction", but my requirement is i wanna disply some contents in the new window after user will click on EDIT.

waiting for reply.

Thanks

VIV
 
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JavaScript function is wrong

function openw()

onclick handler is wrong

onclick="openw()"

Eric
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!