The <include-script> element works well for including a specified *static* script just once.
Another option is to use a flag to indicate whether the dynamic script, or even a portion of a dynamic script, should be included. The value for the flag can be stored as a IRequestCycle attribute. The Palette originally used this approach; until I refactored its JavaScript needs into purely static scripting (included once) and a per-Palette dynamic portion. I do hope you'll contribute this component! This is something I've been trying to find the time to write for a bit. Please see the new Tapestry Contributor's Guide (in the 2.0.4 distro) for more information. -- [EMAIL PROTECTED] http://tapestry.sf.net > We are developing a Date Input ComboBox Form component (with drop down boxes > that auto-handle the number of days in a month, including support for > leapyear), and we have a javascript that handles that and we need to include > it, but we only want to include the script once in a page, no matter how > many components we put in a page (we have one page that has 2 - 3 of these). > We are looking at using Body.includeScript and a context Asset, but I was > wondering if anyone else had any other ideas. I looked at what Rollover > does, but it adds new script everytime a component is used. > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Tapestry-developer mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/tapestry-developer _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ Tapestry-developer mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/tapestry-developer
