• 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

Pop up from an html:link with an action attribute

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone.

Although I think this is a relatively easy thing to do, I can't quite figure it out. I have the jsp code below which works fine:

<html:link action="/notice/search/data" paramId="lineItemId" paramName="lineItemForms" paramProperty="noticeLineItem.id">

Now what I'm trying to do is have a little popup window appear when that link is clicked on. I do have a js function already written to do it...but i don't know where to call it from, or exactly what to pass into it for that matter. The function looks like this and also works fine by itself:

function openSearchWindow(url)
{
if (isBrowserNetscape)
{
// Netscape
window.open(url, "flisWindow", "height=318, width=553, screenX=100, screenY=100, menubar=no, toolbar=no, status=no, scrollbars=yes");
}
else
{
// IE
window.open(url, "flisWindow", "height=318, width=553, left=200, top=200, menubar=no, toolbar=no, status=no, scrollbars=yes");
}
}

So I'm not sure if I want to call an onclick from the html:link (which doesn't seem to work because that doesn't really use the "action" in the tag then does it?) or if I just want to have a "target" attribute in there somehow? Or maybe even write it into the struts-config somehow (i am using struts as well)?

Any time you spend on this is very appreciated,
bryan
 
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
You wouldn't use <html:link> at all. Create a span or button or whatever with an on-click handler that calls window.open() with the fully-formed URL of your desired action.

Since this is a client-side issue, I'm moving this along to the HTML/Javascript forum for any further discussion.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic