You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nancy Lin <co...@yahoo.com> on 2005/05/04 17:59:53 UTC
Overwriting HtmlTag
Hi all,
I have bunch of jsp with html tag and I want to automatically
generate onchange function whent user changes/modified the data.
Since the function that will be called on onChange will be the same
throught out, I do not want every developer to go to each JSP(there
are hundreds of file) and implement the onchange method on each
field. I want to be able to overwrite the html tag to automatically
generate the onchange function.
Any good idea?
Nancy.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Overwriting HtmlTag
Posted by Cliff Lam <cl...@reinfo.com.hk>.
I bind the onchange function dynamically at the client side using
javascript.
But I don't know if it is a good idea.
Cliff
----- Original Message -----
From: "Nancy Lin" <co...@yahoo.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, May 04, 2005 11:59 PM
Subject: Overwriting HtmlTag
> Hi all,
>
> I have bunch of jsp with html tag and I want to automatically
> generate onchange function whent user changes/modified the data.
> Since the function that will be called on onChange will be the same
> throught out, I do not want every developer to go to each JSP(there
> are hundreds of file) and implement the onchange method on each
> field. I want to be able to overwrite the html tag to automatically
> generate the onchange function.
>
> Any good idea?
>
> Nancy.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Overwriting HtmlTag
Posted by James Mitchell <jm...@apache.org>.
Sort of a hack, but you could achieve this during the build with the Ant
replace tag.
Here's a related topic:
http://raibledesigns.com/page/rd?anchor=trim_spaces_in_your_jsp
Based on what Yann posted in a comment, you could modify it to do what you
need.
<replaceregexp match=">html:form<" replace=">html:form
onclick="do.your.java.script.here"e<" flags="g" byline="false">
<fileset dir="${build.home}" includes="**/*.jsp,**/*.tag"/>
</replaceregexp>
Be advised though, I did not try the above, that was off the top of my head.
--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx
Yahoo: jmitchtx
MSN: jmitchell@apache.org
----- Original Message -----
From: "Nancy Lin" <co...@yahoo.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, May 04, 2005 11:59 AM
Subject: Overwriting HtmlTag
> Hi all,
>
> I have bunch of jsp with html tag and I want to automatically
> generate onchange function whent user changes/modified the data.
> Since the function that will be called on onChange will be the same
> throught out, I do not want every developer to go to each JSP(there
> are hundreds of file) and implement the onchange method on each
> field. I want to be able to overwrite the html tag to automatically
> generate the onchange function.
>
> Any good idea?
>
> Nancy.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Overwriting HtmlTag
Posted by Dakota Jack <da...@gmail.com>.
I hate to be blunt, Nancy, but the answer is just to do as you say:
change the html tag code That is the virtue of code that is
decoupled. You can change the code in one place with the effects
rippling throughout your code. If you want the code to remain
consistent with Struts and to be more portable, then you could extend
the html tag and change the references at the top of the files merely.
On 5/4/05, Nancy Lin <co...@yahoo.com> wrote:
> Hi all,
>
> I have bunch of jsp with html tag and I want to automatically
> generate onchange function whent user changes/modified the data.
> Since the function that will be called on onChange will be the same
> throught out, I do not want every developer to go to each JSP(there
> are hundreds of file) and implement the onchange method on each
> field. I want to be able to overwrite the html tag to automatically
> generate the onchange function.
>
> Any good idea?
>
> Nancy.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org