This content has been marked as final.
Show 5 replies
-
1. Re: Problem with JSF- Component IDs and JavaScript Element-I
wesleyhales Apr 1, 2008 8:29 AM (in response to ameo)give your element a name
<form id="" name="whatever"
... document.getElementByName('whatever') ...
portal namespace and jsf generated id has to happen. -
2. Re: Problem with JSF- Component IDs and JavaScript Element-I
wesleyhales Apr 1, 2008 8:41 AM (in response to ameo)oops, that should be:
document.getElementsByName('whatever')[0]
this is a collection which you should probably iterate to get the name you need. -
3. Re: Problem with JSF- Component IDs and JavaScript Element-I
wesleyhales Apr 1, 2008 8:50 AM (in response to ameo)Ok, so I was wrong again. I forgot JSF namespaces the name attribute also. You can wrap your form in a div or span and access the child, or you can use the prototype.js library and they have the following:
document.getElementsByClassName('whatever')[0]
then you would have:<form id="..." styleClass="whatever">
that is my answer and I am sticking to it. Don't forget to make that classname unique and you shouldn't have a problem. -
4. Re: Problem with JSF- Component IDs and JavaScript Element-I
ameo Apr 1, 2008 8:51 AM (in response to ameo)Hi, thanks for reply.
problem...the JSF- Component <h:form> have not a name-attribut. -
5. Re: Problem with JSF- Component IDs and JavaScript Element-I
wesleyhales Apr 1, 2008 9:22 AM (in response to ameo)yep, see my last post