Since it's a finite set of cases, you might be able to use jQuery's awesome
ability to gather information together and meet both requirements with very
little work.  If you assign non-visual classes to the inputs then use a
single script tag at the end of the document to bind all the inputs to their
scripts it should be relatively quick and easy.  Something like this:
  (*Chris*)

    <input type="text" name="myTooltippedInput" value="foo"
class="s2jq_tooltip"/>
  </body>
  <script>
    $(function() {
      $(".s2jq_tooltip").tooltip();
      $(".s2jq_feature2").bind("feature2",feature2);
    });
  </script>
</html>


On Wed, Aug 12, 2009 at 6:57 AM, Johannes Geppert <jo...@web.de> wrote:

>
> Hello Eric,
>
> thank you for fast response.
>
>
> Obinna wrote:
> >
> > What I have done is to put all of the meat of the javascript code into a
> > single file which is included in the sj:head and then just have a small
> > binding snippet code rendered with each tag which calls a binding
> function
> > in the main .js file.
> >
> I think also about this, but i dislike some thinks.
>
> 1.) When supporting all Widgets and interactions with one javascript file,
> this file grows really fast.
>
> 2.) This big javascript was loaded on every single page
>
> 3.) When I use the standard jQuery way, the user know it and can better
> find
> there own failures and can report better error messages
>
> 4.) For my opinion is a large javascript file harder to debug and maintain
> as some freemarker files
>
>
>
> Obinna wrote:
> >
> > This way, the addition to the freemarker templates is almost thoughtless
> > and
> > the you don't place the (IMO) overburdening requirement to add yet
> another
> > <footer/> tag for the developer.
> >
> You are right, and it was just an Idea. Maybe it can be optional.
>
> -----
> ---
> web: http://www.jgeppert.com
> twitter: http://twitter.com/jogep
>
> --
> View this message in context:
> http://www.nabble.com/Create-a-single-javascript-tp24935752p24937153.html
> Sent from the Struts - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@struts.apache.org
> For additional commands, e-mail: dev-h...@struts.apache.org
>
>

Reply via email to