You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Arron Bates <ar...@keyboardmonkey.com> on 2002/05/02 08:46:18 UTC

Re: increased JavaScript support in the link tag.

After some deep thought...
(any HHGTTG fans out there? :)

It all sounds quite ok as to what it is you're trying to do. I do think 
that an efficient routing of the link interaction through JavaScript is 
a good thing. It is a very "viewy" thing people want to do.

Looking at it from the end developer's point of view, I'd be after the 
following  with various parameters...
(what of the following is true?)
a) function only. Just call the function, no argument, no url.
b) page, function. Function with URL as the only argument.
c) page, function, functionName, functionProperty. As you describe.
c) function, functionName, functionProperty. As you describe, but no url.

And in all cases, the urlIndex to be optional, and default to 0 (the 
first arg). Is this how it's all working?...
With it working like above, I'll have no problems taking it on to commit it
(naturally with the absence of -1's. I don't think that this is anything 
paradigm changing, but that's the process).

Internally, it will need a little house keeping. The "if"'s without the 
"{" block, and if you can call the Request utils.lookup, rather than the 
duplication in the EcmaUtils.

I'll also need to do some testing on it. Any unit tests?... A simple one 
page webapp that I can run tests against, regression tests etc?... or do 
I have to make one?... Not too much of a drama either way.


Arron.


Phase Web and Multimedia wrote:

>The tag "is" a Link Tag. I by no means want to create a new tag. If you read
>my explanation I state that. The additional attributes are neccessary
>though. The reason being is that the functionality is not in the current
>Link tag to accomplish this. It has unique requirements that present the
>need for an expanded set of Attributes on the Link tag. The idea is to be
>able to "include" the action url into the javascript function call at a
>specified an index point along with other parameters one might need to send
>to the javascript function. The other goal is to be able to prepare these
>parameters and place them into a bean.
>
>For example:
>
>If you have a popup window and you want to customize the size of the pop up.
>You might prepare some size parameters for the popup window that you want to
>be dynamic. With the tag I spun it allows for this to happen. You can
>prepare the parameters yo want to pass to the javascript function in the
>Action class and place it into a request bean (or whatever scope) and draw
>those prepared parameters from the bean into the Link tag which then (of
>course) would call the javascript function.
>
>I am not sure what you are getting at, though. Did you read the
>documentation that I wrote. It states that the attributes are added
>functionality to the Link Tag. :-)
>
>I think I have already done what you are saying. Please, correct me if I am
>misunderstanding you. I am using the base functionality of the Link Tag. I
>developed a whole new tag because I didn't have a choice. The intent was
>always to incorporate the functionality into the Link tag. Maybe to avoid
>confusion I need to go ahead and download the nightly and do a patch
>submission. rather than a code submission than can be placed back into the
>core struts Link tag.
>
>Brandon Goodin
>Phase Web and Multimedia
>P (406) 862-2245
>F (406) 862-0354
>mail@phase.ws
>http://www.phase.ws
>
>
>-----Original Message-----
>From: Arron Bates [mailto:arronb@pacific.net.au]
>Sent: Wednesday, May 01, 2002 10:45 PM
>To: Struts Users Mailing List
>Subject: Re: Check this out!
>
>
>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
>>mail@phase.ws
>>
>>
>>
>>--
>>To unsubscribe, e-mail:
>>
><ma...@jakarta.apache.org>
>
>>For additional commands, e-mail:
>>
><ma...@jakarta.apache.org>
>
>>
>
>
>
>--
>To unsubscribe, e-mail:
><ma...@jakarta.apache.org>
>For additional commands, e-mail:
><ma...@jakarta.apache.org>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: increased JavaScript support in the link tag.

Posted by Phase Web and Multimedia <ma...@phase.ws>.
Arron,

Let me preface this email with the understanding that I developed this about
2 months ago and am using it on a site now. So, I haven't thought about it
for a while and so my memory of it might be presumptuous in some areas
(sigh! I wish my mind were a computer). Notes are mingled with your reply:

>After some deep thought...
>(any HHGTTG fans out there? :)
What's HHGTTG not familiar with that one. :-)


>It all sounds quite ok as to what it is you're trying to do. I do think
>that an efficient routing of the link interaction through JavaScript is
>a good thing. It is a very "viewy" thing people want to do.

>Looking at it from the end developer's point of view, I'd be after the
>following  with various parameters...
>(what of the following is true?)
>a) function only. Just call the function, no argument, no url.

true

>b) page, function. Function with URL as the only argument.

true

>c) page, function, functionName, functionProperty. As you describe.

true

>c) function, functionName, functionProperty. As you describe, but no url.

true

>And in all cases, the urlIndex to be optional, and default to 0 (the
>first arg). Is this how it's all working?...

yes

>With it working like above, I'll have no problems taking it on to commit it
>(naturally with the absence of -1's. I don't think that this is anything
>paradigm changing, but that's the process).

Can you explain -1's?

>Internally, it will need a little house keeping. The "if"'s without the
>"{" block, and if you can call the Request utils.lookup, rather than the
>duplication in the EcmaUtils.

Yes, I need to brush up on the conventions. Hopefully, I haven't made the
code too ugly for you :-)

>I'll also need to do some testing on it. Any unit tests?... A simple one
>page webapp that I can run tests against, regression tests etc?... or do
>I have to make one?... Not too much of a drama either way.

All, I have is a site that I am currently using it in. I also need to brush
up on unit testing. :-\  I haven't done any... ever! But, shhh! I don't want
to look dumb. ;-) Any suggestions on where I can bone up on unit testing?

Thanks,
Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
mail@phase.ws
http://www.phase.ws



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: increased JavaScript support in the link tag.

Posted by Arron Bates <ar...@keyboardmonkey.com>.
>
>
>Interesting idea.  But I'd really like to get 1.1 out the door before
>adding lots of new functionaltiy ...
>

Not a problem.

>One of the things I learned, in watching the development of JSTL, is that
>tags with lots and lots of optional attributes, and different operating
>modes, can be really hard to understand -- and that describes quite a
>number of Struts tags today.  Given that, we might want to call this one
><html:javascript> or <html:action> or something, even though deep down it
>really does generate a hyperlink.  Doing it as a separate tag also means
>you could focus on just the attributes you need for this purpose (i.e. no
>need to have the attributes to build up a URL).
>

Yes, would agree, but the first thought which I had about it was that it 
could be used to simply redirect the action of the link with a single 
parameter. Easily being a toggle for going through the JS or not. It's 
just that there's a couple more to do the same kind of building for the 
JS arguments. There's already a "javascript" Struts tag too from David.


Brandon:
The -1 & +1 business is the decision making process...
http://jakarta.apache.org/site/decisions.html

Unit tests...
http://www.junit.org/index.htm
...personally though, I'd rather have a small specific environment linke 
a page or something so I can watch it dance. In this case, simply a page 
that has a list of links which go over all the different cases the tag 
is meant to do. Unit tests are more than just a harness. For an 
automated build/test process and whatever. Anyways, the link has way 
more information than I could ever spiel.


Arron.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: increased JavaScript support in the link tag.

Posted by Phase Web and Multimedia <ma...@phase.ws>.
good point

-----Original Message-----
From: Craig R. McClanahan [mailto:craigmcc@apache.org]
Sent: Thursday, May 02, 2002 9:52 AM
To: Struts Developers List
Subject: Re: increased JavaScript support in the link tag.


Interesting idea.  But I'd really like to get 1.1 out the door before
adding lots of new functionaltiy ...

One of the things I learned, in watching the development of JSTL, is that
tags with lots and lots of optional attributes, and different operating
modes, can be really hard to understand -- and that describes quite a
number of Struts tags today.  Given that, we might want to call this one
<html:javascript> or <html:action> or something, even though deep down it
really does generate a hyperlink.  Doing it as a separate tag also means
you could focus on just the attributes you need for this purpose (i.e. no
need to have the attributes to build up a URL).

Craig


On Thu, 2 May 2002, Arron Bates wrote:

> Date: Thu, 02 May 2002 16:46:18 +1000
> From: Arron Bates <ar...@keyboardmonkey.com>
> Reply-To: Struts Developers List <st...@jakarta.apache.org>
> To: Struts Developers List <st...@jakarta.apache.org>
> Subject: Re: increased JavaScript support in the link tag.
>
> After some deep thought...
> (any HHGTTG fans out there? :)
>
> It all sounds quite ok as to what it is you're trying to do. I do think
> that an efficient routing of the link interaction through JavaScript is
> a good thing. It is a very "viewy" thing people want to do.
>
> Looking at it from the end developer's point of view, I'd be after the
> following  with various parameters...
> (what of the following is true?)
> a) function only. Just call the function, no argument, no url.
> b) page, function. Function with URL as the only argument.
> c) page, function, functionName, functionProperty. As you describe.
> c) function, functionName, functionProperty. As you describe, but no url.
>
> And in all cases, the urlIndex to be optional, and default to 0 (the
> first arg). Is this how it's all working?...
> With it working like above, I'll have no problems taking it on to commit
it
> (naturally with the absence of -1's. I don't think that this is anything
> paradigm changing, but that's the process).
>
> Internally, it will need a little house keeping. The "if"'s without the
> "{" block, and if you can call the Request utils.lookup, rather than the
> duplication in the EcmaUtils.
>
> I'll also need to do some testing on it. Any unit tests?... A simple one
> page webapp that I can run tests against, regression tests etc?... or do
> I have to make one?... Not too much of a drama either way.
>
>
> Arron.
>
>
> Phase Web and Multimedia wrote:
>
> >The tag "is" a Link Tag. I by no means want to create a new tag. If you
read
> >my explanation I state that. The additional attributes are neccessary
> >though. The reason being is that the functionality is not in the current
> >Link tag to accomplish this. It has unique requirements that present the
> >need for an expanded set of Attributes on the Link tag. The idea is to be
> >able to "include" the action url into the javascript function call at a
> >specified an index point along with other parameters one might need to
send
> >to the javascript function. The other goal is to be able to prepare these
> >parameters and place them into a bean.
> >
> >For example:
> >
> >If you have a popup window and you want to customize the size of the pop
up.
> >You might prepare some size parameters for the popup window that you want
to
> >be dynamic. With the tag I spun it allows for this to happen. You can
> >prepare the parameters yo want to pass to the javascript function in the
> >Action class and place it into a request bean (or whatever scope) and
draw
> >those prepared parameters from the bean into the Link tag which then (of
> >course) would call the javascript function.
> >
> >I am not sure what you are getting at, though. Did you read the
> >documentation that I wrote. It states that the attributes are added
> >functionality to the Link Tag. :-)
> >
> >I think I have already done what you are saying. Please, correct me if I
am
> >misunderstanding you. I am using the base functionality of the Link Tag.
I
> >developed a whole new tag because I didn't have a choice. The intent was
> >always to incorporate the functionality into the Link tag. Maybe to avoid
> >confusion I need to go ahead and download the nightly and do a patch
> >submission. rather than a code submission than can be placed back into
the
> >core struts Link tag.
> >
> >Brandon Goodin
> >Phase Web and Multimedia
> >P (406) 862-2245
> >F (406) 862-0354
> >mail@phase.ws
> >http://www.phase.ws
> >
> >
> >-----Original Message-----
> >From: Arron Bates [mailto:arronb@pacific.net.au]
> >Sent: Wednesday, May 01, 2002 10:45 PM
> >To: Struts Users Mailing List
> >Subject: Re: Check this out!
> >
> >
> >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
> >>mail@phase.ws
> >>
> >>
> >>
> >>--
> >>To unsubscribe, e-mail:
> >>
> ><ma...@jakarta.apache.org>
> >
> >>For additional commands, e-mail:
> >>
> ><ma...@jakarta.apache.org>
> >
> >>
> >
> >
> >
> >--
> >To unsubscribe, e-mail:
> ><ma...@jakarta.apache.org>
> >For additional commands, e-mail:
> ><ma...@jakarta.apache.org>
> >
> >
> >
> >--
> >To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> >For additional commands, e-mail:
<ma...@jakarta.apache.org>
> >
> >
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: increased JavaScript support in the link tag.

Posted by "Craig R. McClanahan" <cr...@apache.org>.
Interesting idea.  But I'd really like to get 1.1 out the door before
adding lots of new functionaltiy ...

One of the things I learned, in watching the development of JSTL, is that
tags with lots and lots of optional attributes, and different operating
modes, can be really hard to understand -- and that describes quite a
number of Struts tags today.  Given that, we might want to call this one
<html:javascript> or <html:action> or something, even though deep down it
really does generate a hyperlink.  Doing it as a separate tag also means
you could focus on just the attributes you need for this purpose (i.e. no
need to have the attributes to build up a URL).

Craig


On Thu, 2 May 2002, Arron Bates wrote:

> Date: Thu, 02 May 2002 16:46:18 +1000
> From: Arron Bates <ar...@keyboardmonkey.com>
> Reply-To: Struts Developers List <st...@jakarta.apache.org>
> To: Struts Developers List <st...@jakarta.apache.org>
> Subject: Re: increased JavaScript support in the link tag.
>
> After some deep thought...
> (any HHGTTG fans out there? :)
>
> It all sounds quite ok as to what it is you're trying to do. I do think
> that an efficient routing of the link interaction through JavaScript is
> a good thing. It is a very "viewy" thing people want to do.
>
> Looking at it from the end developer's point of view, I'd be after the
> following  with various parameters...
> (what of the following is true?)
> a) function only. Just call the function, no argument, no url.
> b) page, function. Function with URL as the only argument.
> c) page, function, functionName, functionProperty. As you describe.
> c) function, functionName, functionProperty. As you describe, but no url.
>
> And in all cases, the urlIndex to be optional, and default to 0 (the
> first arg). Is this how it's all working?...
> With it working like above, I'll have no problems taking it on to commit it
> (naturally with the absence of -1's. I don't think that this is anything
> paradigm changing, but that's the process).
>
> Internally, it will need a little house keeping. The "if"'s without the
> "{" block, and if you can call the Request utils.lookup, rather than the
> duplication in the EcmaUtils.
>
> I'll also need to do some testing on it. Any unit tests?... A simple one
> page webapp that I can run tests against, regression tests etc?... or do
> I have to make one?... Not too much of a drama either way.
>
>
> Arron.
>
>
> Phase Web and Multimedia wrote:
>
> >The tag "is" a Link Tag. I by no means want to create a new tag. If you read
> >my explanation I state that. The additional attributes are neccessary
> >though. The reason being is that the functionality is not in the current
> >Link tag to accomplish this. It has unique requirements that present the
> >need for an expanded set of Attributes on the Link tag. The idea is to be
> >able to "include" the action url into the javascript function call at a
> >specified an index point along with other parameters one might need to send
> >to the javascript function. The other goal is to be able to prepare these
> >parameters and place them into a bean.
> >
> >For example:
> >
> >If you have a popup window and you want to customize the size of the pop up.
> >You might prepare some size parameters for the popup window that you want to
> >be dynamic. With the tag I spun it allows for this to happen. You can
> >prepare the parameters yo want to pass to the javascript function in the
> >Action class and place it into a request bean (or whatever scope) and draw
> >those prepared parameters from the bean into the Link tag which then (of
> >course) would call the javascript function.
> >
> >I am not sure what you are getting at, though. Did you read the
> >documentation that I wrote. It states that the attributes are added
> >functionality to the Link Tag. :-)
> >
> >I think I have already done what you are saying. Please, correct me if I am
> >misunderstanding you. I am using the base functionality of the Link Tag. I
> >developed a whole new tag because I didn't have a choice. The intent was
> >always to incorporate the functionality into the Link tag. Maybe to avoid
> >confusion I need to go ahead and download the nightly and do a patch
> >submission. rather than a code submission than can be placed back into the
> >core struts Link tag.
> >
> >Brandon Goodin
> >Phase Web and Multimedia
> >P (406) 862-2245
> >F (406) 862-0354
> >mail@phase.ws
> >http://www.phase.ws
> >
> >
> >-----Original Message-----
> >From: Arron Bates [mailto:arronb@pacific.net.au]
> >Sent: Wednesday, May 01, 2002 10:45 PM
> >To: Struts Users Mailing List
> >Subject: Re: Check this out!
> >
> >
> >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
> >>mail@phase.ws
> >>
> >>
> >>
> >>--
> >>To unsubscribe, e-mail:
> >>
> ><ma...@jakarta.apache.org>
> >
> >>For additional commands, e-mail:
> >>
> ><ma...@jakarta.apache.org>
> >
> >>
> >
> >
> >
> >--
> >To unsubscribe, e-mail:
> ><ma...@jakarta.apache.org>
> >For additional commands, e-mail:
> ><ma...@jakarta.apache.org>
> >
> >
> >
> >--
> >To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> >For additional commands, e-mail: <ma...@jakarta.apache.org>
> >
> >
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>