Digging there even further, it seems that the old addScripts() had a bug that Tapestry.ScriptManager.contains(document.scripts, "src", ...) would silently throw the exception every time, and the scripts would never get reloaded, which masked the problem.
With this code reworked, scripts actually get reloaded and that seems to be causing a problem with datepicker 'losing' its prototype. On Oct 22, 2011, at 12:53 AM, Lenny Primak wrote: > Digging further into this, the problem is actually triggered by the GWT > JavaScript that's on the same page. > I can't reproduce this unless I have a GWT component on that page, any GWT > component. > > I believe something was broken with > http://svn.apache.org/viewvc?view=revision&revision=1186564 > It seems to load and call scripts in the wrong order now. > Seems like Tapestry.DateField.prototype is undefined after then AJAX call to > render the zone. > > > On Oct 21, 2011, at 3:05 PM, Lenny Primak wrote: > >> Just upgraded to beta-26, and started getting JavaScript errors when >> submitting an AJAX form. >> >> <t:zone t:id="searchZone"> >> <div t:type="button" cut="left"> >> <t:beaneditform t:id="searchForm" object="search" >> zone="searchZone"> >> </t:beaneditform> >> </div> >> </t:zone> >> >> search object has a Date (hence the DateField bean) >> >> I get the following errors starting sometime after beta-21 (it worked >> perfectly in beta-21) >> >> Exception invoking function Tapestry.Initializer.evalScript with parameters >> ["Tapestry.DateField.initLocalization({\n \"firstDay\" : 6,\n \"months\" : >> [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n >> \"May\",\n \"June\",\n \"July\",\n \"August\",\n >> \"September\",\n \"October\",\n \"November\",\n \"December\",\n >> \"\"\n ],\n \"days\" : \"mtwtfss\"\n});"]: TypeError: 'undefined' is not >> an object (evaluating 'Tapestry.DateField.prototype.firstDay = >> localization.firstDay') >> t5-console.js:61Exception invoking function Tapestry.Initializer.dateField >> with parameters >> [{"field":"dateFrom_13327d9e159","formatURL":"/test/test/tappage.datefield:format?t:cp=core/propertyeditblocks","parseURL":"/test/test/tappage.datefield:parse?t:cp=core/propertyeditblocks"}]: >> TypeError: '[Class ID:undefined]' is not a constructor (evaluating 'new >> Tapestry.DateField(spec)') >> t5-console.js:61Exception invoking function Tapestry.Initializer.dateField >> with parameters >> [{"field":"dateTo_13327d9e159","formatURL":"/test/test/tappage.datefield:format?t:cp=core/propertyeditblocks","parseURL":"/test/test/tappage.datefield:parse?t:cp=core/propertyeditblocks"}]: >> TypeError: '[Class ID:undefined]' is not a constructor (evaluating 'new >> Tapestry.DateField(spec)') >