Re: increased JavaScript support in the link tag.

2002-05-02 Thread Arron Bates

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
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Arron Bates [mailto:[EMAIL PROTECTED]]
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 

RE: increased JavaScript support in the link tag.

2002-05-02 Thread Phase Web and Multimedia

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
[EMAIL PROTECTED]
http://www.phase.ws



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: increased JavaScript support in the link tag.

2002-05-02 Thread Craig R. McClanahan

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 [EMAIL PROTECTED]
 Reply-To: Struts Developers List [EMAIL PROTECTED]
 To: Struts Developers List [EMAIL PROTECTED]
 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
 [EMAIL PROTECTED]
 http://www.phase.ws
 
 
 -Original Message-
 From: Arron Bates [mailto:[EMAIL PROTECTED]]
 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

OT: Re: increased JavaScript support in the link tag.

2002-05-02 Thread @Basebeans.com

Subject: OT: Re: increased JavaScript support in the link tag.
From: Jose Quinteiro [EMAIL PROTECTED]
 ===
Phase Web and Multimedia wrote:
After some deep thought...
(any HHGTTG fans out there? :)
 
 What's HHGTTG not familiar with that one. :-)

Hitchhiker's Guide to the Galaxy.  Deep thought was the name of the 
first computer the white mice (or the dokphins?) created to answer the 
question of Life, the Universe, and Everything.

Sorry for the OT.


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: increased JavaScript support in the link tag.

2002-05-02 Thread Phase Web and Multimedia

good point

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
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 [EMAIL PROTECTED]
 Reply-To: Struts Developers List [EMAIL PROTECTED]
 To: Struts Developers List [EMAIL PROTECTED]
 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
 [EMAIL PROTECTED]
 http://www.phase.ws
 
 
 -Original Message-
 From: Arron Bates [mailto:[EMAIL PROTECTED]]
 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

RE: increased JavaScript support in the link tag.

2002-05-02 Thread Tim Moore

+1 ;-) In general I'd say that any time you're thinking of having
different modes of operations for a tag, you're probably better off just
making another tag.

-- 
Tim Moore / Blackboard Inc. / Software Engineer
1899 L Street, NW / 5th Floor / Washington, DC 20036
Phone 202-463-4860 ext. 258 / Fax 202-463-4863


 -Original Message-
 From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, May 02, 2002 11: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 [EMAIL PROTECTED]
  Reply-To: Struts Developers List [EMAIL PROTECTED]
  To: Struts Developers List [EMAIL PROTECTED]
  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
  [EMAIL PROTECTED]
  http

Re: OT: Re: increased JavaScript support in the link tag.

2002-05-02 Thread Arron Bates

Correct. :)

Arron.

Struts-dev Newsgroup (@Basebeans.com) wrote:

Subject: OT: Re: increased JavaScript support in the link tag.
From: Jose Quinteiro [EMAIL PROTECTED]
 ===
Phase Web and Multimedia wrote:

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

What's HHGTTG not familiar with that one. :-)


Hitchhiker's Guide to the Galaxy.  Deep thought was the name of the 
first computer the white mice (or the dokphins?) created to answer the 
question of Life, the Universe, and Everything.

Sorry for the OT.


--
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]




Re: increased JavaScript support in the link tag.

2002-05-02 Thread Arron Bates



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:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]