Anyone would think that trying to get an opinion on something is an uphill battle. :)
Instead of creating an entirely new tag, can you take a look at adapting the current one?... Reason I say this, is that there's already a tag there, and this tag will need another name besides "link". "scriptlink" or something. An extra tag for people to learn. Because the logic is already there to do the mapping, and the querystring appending etc etc, I think it would be easier to simply add an extra parameter called "script" or something that when set to the name of a JS function, that when present, will wrap the resulting URL in the java script function. This means that *all* current links could turn into JavaScript routed links by adding one parameter, and inversely go back by removing it. Which I think would be quite sweet. Otherwise, it may turn out to be just a tag with an esoteric use. Your thoughts?... Arron. Phase Web and Multimedia wrote: >Hey all, > >I submitted an enhancement to struts. Read the following and if it sounds >worth having in struts give me a vote on the developer's list or make some >noise for some of the gurus to see. > >The code is at the following url in zip format: > >Here is the info on the tag: >http://www.phase.ws/linktag/taglib.zip > >I don't know if a similar solution has been provided, but, I tweaked the >Link Tag to support the writing of >'javascript:[function_name]([param1,param2,param3...])' to the href >attribute of the final output. Here is a summarization of it's >functionality: > >I added the following attributes: > >function - This is the name of the javascript function that will be called; > >functionName - This is the name of the bean that will provide parameter >values from one of it's properties. > >functionProperty - This is a property of a bean that will either provide a >String or an ArrayList to populate the parameters of the function > >urlIndex - This allows you to include the url generated by href,forward or >page to be included at a specific place in the function's parameters. > >There is another class that I wrote that does the actual processing and >preparation of the url. I named it EcmaUtil. I modeled the computeURL and >computerParam methods of the RequestUtils class when I built the methods for >the EcmaUtil. > >The LinkTag class that I wrote extends the BaseHandlerTag under the >org.apache.struts.taglib.html package of struts jar. > >I know the code needs a bit of reworking to fit back in to the struts >framework. I stripped out the MessageReources for the most part and removed >some exception handling that will need to be included again. > >Anyways, if nobody has done this in the nightly or if it sounds like it >might be of use. Let me know and I will post the code,the tld and an example >of it's usage. > >EXAMPLE OF USAGE: > >This tag works exactly like the struts html tag with expanded feature >outlined above: > ><pwshtml:link forward="listings/detail/popup" function="popUpWin" >urlIndex="1" paramId="image" paramName="image"> ><img src="image.jpg"> some text</pwshtml:link> > >This code will produce the follwing html ><a >href="javascript:popUpWin('/do/listings/detail/popup?image=NWMT203336.jpg')" > >><img src="image.jpg"></a> >> > >Of course some of the elements are arbitrary to the values in your beans. >But you should be able to traverse the code and get the idea. > >Thanks in advance. >Brandon Goodin >Phase Web and Multimedia >P(406)862-2245 >F(406)862-0354 >http://www.phase.ws >[EMAIL PROTECTED] > > > >-- >To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> >For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

