Only 49 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Pop up from an html:link with an action attribute  RSS feed

 
bryan nelson
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!