> > Why use a struts tag to generate a non-struts link? > >Dave >
Dave, The OP wrote: > It really, really needs to work this way. So I am going to assume that it does. And, this seems like a perfectly reasonable thing to do. If a company has existing functionality in javascript, they want to link to it. It is illogical to expect them to rewrite their javascript stuff in Struts. Or in anything else, for that matter. Dennis, We do the same thing here and it's not complicated to do. I don't think you need to mess with the <html:link> tag. Just create the tag normally, the same way as you would sans Struts, and use your beans to supply the values. The three properties are prop1, prop2, prop3. <logic:iterate id="listdata" name="theList" type="putTheFullClassNameHere" scope="page"> <tr> <td> <a href="javascript:showStuffForPerson( '<bean:write name="listdata" property="prop1"/>', '<bean:write name="listdata" property="prop2"/>', '<bean:write name="listdata" property="prop3"/>')"> <bean:write name="listdata" property="prop1"/> </a> </td> Have fun. --Tom -----Original Message----- From: Dave Newton [mailto:davelnew...@gmail.com] Sent: Wednesday, December 22, 2010 10:09 AM To: Struts Users Mailing List Subject: Re: Invoking Javascript function from Struts 1.3 Why use a struts tag to generate a non-struts link? Dave On Tuesday, December 21, 2010, Dennis Atkinson <dennisatkinson...@yahoo.com> wrote: > Greetings all. > > I have a problem invoking Javascript that I can't seem to solve. I'm hoping > someone here has run into the same kind of thing. > > When I am iterating through a List of items to display (via the > <logic:iterate> tag), one cell I am trying to write has to be a link to a > Javascript function, with three parameters. If I wasn't using Struts, I'd > write standard html, like so: > > <a href="javascript:showStuffForPerson('405574', '459', '3')">405574</a> > > But if I do this in Struts, I get that exact string in the cell, which isn't > what I want. I need to have 405574 in the cell, and when I click on it, the > javascript has to be invoked with those three parameters. It really, really > needs to work this > way. > > I tried experimenting with the <html:link> tag, and it *seems* like that's > the way to go, but I am lost with respect to the associated <html:param> > tags. I assume I'll need three of them (one for each parameter), but I can't > seem to make that work. If I give them a name, it doesn't work, and if I > don't give them a name that doesn't work any better. > > Or maybe I'm going about this all wrong? > > Any assistance would be very much appreciated. > > Thanks in advance, > > Dennis > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org This message is intended for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Barclays Capital Inc., its subsidiaries or affiliates. Barclays Wealth is the wealth management division of Barclays Bank PLC, functioning through Barclays Capital Inc. in the United States. Barclays Capital Inc. is a U.S. registered broker-dealer and is regulated by the U.S. Securities & Exchange Commission. Member SIPC. For more information, visit us at: www.barcap.com. IRS Circular 230 Disclosure: Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org