Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

getElementById in JSF

843844Apr 13 2008 — edited Apr 13 2008
Hi guys,

i've already been searchin the net and this forum for my problem and i didnt find any solution. There are a lot of topics around my problem, but the most have some kind of form on their pages or different ID in their elements after rendering. I dont have any form yet and i tried that anyways and didnt work eiter.

So, i want to access a html div element via javascript with the document.getElementById() method. The JSF component is:

<h:panelGroup id="div_window" styleClass="div_window" layout="block">
//some Content
</h:panelGroup>

When i take a look in the sourcecode in the browser, then i have everything as expected, like:

<div id="div_window" class="div_window">
//some Conent
</div>

So, when i try to access that element with document.getElementById('div_window');, then it returns null. I have already been looking the html tree and there is a element with that id and it still can't find it?
I have tried to put a div element directly in, like <div id="test"></div> and i get the same result.

So, can some1 give me an hint?

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 11 2008
Added on Apr 13 2008
3 comments
542 views