It is changing indeed. So I guess I will try using getElementsByClassName( 
'i-can-constant')[0] instead. Thanks. 

----- Original Message -----
From: "Taha Hafeez" <tawus.tapes...@gmail.com> 
To: "Tapestry users" <users@tapestry.apache.org> 
Sent: Sunday, March 6, 2011 4:50:07 AM 
Subject: Re: T5.2: Javascript document.getElementById() after zone update 

Hi 

When you click 'View Source Code' in a browser, it shows you the html loaded 
first time the page was loaded and does not show the dom changes done using 
ajax. If you want to see the latest dom, install firebug on firefox(chrome 
has a very similar one by default) and enable it by clicking on the bug icon 
on the status bar. 


Also, how are using getting the element id of select in your javascript ? 

regards 
Taha 


On Sun, Mar 6, 2011 at 10:02 AM, Josh Canfield <joshcanfi...@gmail.com>wrote: 

> If it's in the zone then the id is probably changing. How are you 
> determining that its staying the same? 
> 
> Try using a class instead of id? 
> On Mar 5, 2011 6:45 PM, "Sérgio Esteves" <sergio.este...@xpand-it.com> 
> wrote: 
> > Hi all, 
> > 
> > At the end of a zone block, I call a JS function which tries to get an 
> element (that is also inside the zone) by calling 
> document.getElementById('componentSelectId'). The first time the page loads 
> and the zone is rendered everything works as it should. Although, when I 
> update the zone, by changing the value of a select component, the JS gets 
> executed, but "document.getElementById('componentSelectId')" returns null. 
> Looking at the page source on the web browser I can see that the element is 
> there with the very same id. Anybody can tell what is going on here? 
> > 
> > Thanks. 
> 

Reply via email to