Take a look at forceId as Heath suggests. I basically wrote it for
just such occassions. If you are writing a custom component there is
the option of having the component/renderer generate the javascript in
which case you would know the id. Take a look at the archives for
discussions on forceId for some of the lively debate we had on this
topic. There are pros and cons to each approach.
sean
On Apr 12, 2005 10:42 AM, Heath Borders <[EMAIL PROTECTED]> wrote:
> If you're using the extendd component set for your component, you can use
> the forceId attribute, which will make the clientId equal to the id.
>
> However, if that's not an option the easiest way would probably be just to
> do a component-binding for the component whose clientId you need, and then
> expose the clientId wit a getter.
>
>
>
> On Apr 12, 2005 9:35 AM, Galen Dunkleberger <[EMAIL PROTECTED]>
> wrote:
> > Is there a good way to pull the client id of a particular component in
> > the jsp? What I'm trying to do is pass the id to javascript calls. I
> > know how to figure out the id manually but is would be nice to be able
> > to do something like this...
> >
> > <h:someComponent
> >
> onclick="somejavascriptcall('<%=someothercomponent.getClientId()%>')"
> > />
> >
> > Anyone have any ideas how this might work?
> >
> Thanks,
> >
> Galen
> >
>
>
>
> --
> -Heath Borders-Wing
> [EMAIL PROTECTED]