• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jsp and two javascript statements

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
i need to open the following jsp statement in a pop up window
<a href="javascript:gotoTermsByName('<%=response.encodeURL("Terms")%>',document.editform,'<%=column.getColumnName()%>',','<%="f_" + column.getColumnName().toLowerCase()%>')">Terms List</a>

and i'm also using the follwoing javascript statement
<a href="javascript:windowHandle = window.open('popupwin.html','myExample4','width=500,height=500'); windowHandle.focus()">Example 4</a>

noramlly i would put the ; between the two javascript statements but it doesn't seem to be working.
how do i combine them ?
cheers
chris
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not really a JSP question, so I'm shuffling this along to the HTML/Javascript forum. See you there.
bear
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What I tend to do, in the name of tidyness if nothing else, is to call a Javascript function that can contain as many statements as you want.
For example:

hth,
bear
[ October 20, 2003: Message edited by: Bear Bibeault ]
[ October 20, 2003: Message edited by: Bear Bibeault ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://www10.brinkster.com/A1ien51/scripts/PopUpWinGenV3.htm
 
Chris Davies
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks, ive changed it to the following

<a href="javascript:gotoTermsByName('<%=response.encodeURL("Terms")%>',document.editform,'<%=column.getColumnName()%>',','<%="f_" + column.getColumnName().toLowerCase()%>')" onclick"windowHandle=window.open
('popupwin.html'myExample4','width=500,height=500');
windowHandle.focus();">Terms List</a>
this opens the first window but gives the following error message relating to the window with the specifc parameters.
No such action popupwin. html.
Error caused by: java.lang.ClassNotFoundException: com/opentext/basis/webtop/actions/popupwin/ html

it then opens teh second window with no paramteres
any ideas ?
cheers
chris
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the syntax is wrong, you are missing commas and you quotes are off.
Look at my generator......the link I posted above, will simplfy it
 
Chris Davies
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks.
i've tried posting it into the page but it doesn't do anything. how do i get the generator to know what i want to do ?
for example i'm trying to use the 2 javascript functions but i cant figure out how to do it via the generator. its a good product, i've bookmarked it.
chris
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what exactly are you trying to do, that is what is confusing me.
 
Chris Davies
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i've changed and am trying to now alamgamate the second javascript function
which is

into the following function

what is the syntax for including the onlcick event into this function so that it opens a pop up window ?
[edited code to make it readable - ::Eric::]
[ October 23, 2003: Message edited by: Eric Pascarello ]
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Is there a reason you are avoiding combining the two functions into one like I just did above? Not sire if you are calling the function by itself at other times. I also cleaned up the code so that the commas are correct and you need extra quotes too.

Eric
 
Chris Davies
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no, thats what i meant to do
i'm trying to call the function with teh following code but its just giving me an 'Error on Page'

<a href="javascript:gotoTermsByName('<%=response.encodeURL("Terms")%>',document.editform,'<%=column.getColumnName()%>','<%="f_" + column.getColumnName().toLowerCase()%>')">Terms List</a>
doesn't 'terms.window' and window.handle conflict ?
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you post the generated html code here or send it to my email after it is rendered, so I can figure out the error.
To post it on the site....goto here: http://www10.brinkster.com/a1ien51/JavaRanch/Escaper.htm
it will format the code so you can post it without errors.
Eric
 
Chris Davies
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
cheers eric, i twigged it and its working now.
 
You can't have everything. Where would you put it?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic