You need to do something like: document.thArray = new Array();
On Wed, Apr 23, 2008 at 3:43 PM, Rohan Kalyan <[EMAIL PROTECTED]> wrote: > Hi all, > We moved from tapestry 4.0.2 to 4.1.5 > we were using a script file and in had used the > <initialization></initialization> tag to initialize the values used in > script functions. > The variables defined in this tag were working as global variable and we > used to get the value of these variables in any script function. > After shifting to 4.1.5 the initialization is treated as a different > function and so the variables defined there are local to it, these variables > loose there values as we try to access them in different script functions. > > the code is as follows > <initialization> > var thArray = new Array(); > <foreach key="th" expression="ths"> > thArray[t++] = new Th("${th.thId}", ${th.position}); > </foreach> > swapThArray(); > </initialization> > > function swapThArray() { > var tswap = thArray.length; > for (var k = t; k < t + (thArray.length - t - 1)/2; k++) { > var tempth = thArray[--tswap]; > thArray[tswap] = thArray[k]; > thArray[k] = tempth; > } > } > getting a javascript error in swapThArray that thArray has no properties > > > thanks in advance, > > regards, > -- > Rohan Kalyan > Indygo - www.indygo.in > -- Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]