Hi Simon,

You're right about Tiles, and I can see the issues you've mentioned.

I ended up doing something like what you suggested - in my case I've
just used predictable suffixes for the various things I need to get
to: this.id + "Label", this.id + "Help", etc.

Thanks to all for the advice, and for putting up with a newbie as I
get my head around this stuff.

--Steve

On 12/12/05, Simon Kitching <[EMAIL PROTECTED]> wrote:

>  From the fact that you've got a naming container with id "content" in
> the hierarchy, it looks like you're using Tiles to compose pages. This
> is a prime example of where conflicting ids can occur when forceId is
> used: the authors of all the parts used to compose a page must ensure
> they don't use the same ids in different parts. For me, forceId is like
> hacking Java so that class member variable names can conflict. Yecch.

> Are you aware that in event-handler code called from a DOM component (eg
> an "onclick", the called javascript method can use "this" to refer to
> the component that the event fired on? This can remove the need to know
> the component's id at all in some cases.
>
> Regards,
>
> Simon
>
> Mike Kienenberger wrote:
> > The naming is based on NamingContainers.
> >
> >      * If this component is a descendant of a NamingContainer then the
> >      * client id is of form "{namingContainerId}:{componentId}".
> >
> > I can't remember all of which components implement NamingContainer,
> > but I think it's UIForm and UIData.   UIData uses
> > "{namingContainerId}:{componentId_#}", I believe.
> >
> > I think there's also a tomahawk extension attribute called "forceId",
> > which, when set to true, will bypass naming containers and use the raw
> > id value specified, but I haven't used it.
> >
> > http://myfaces.apache.org/tomahawk/forceId.html
> >
> > On 12/12/05, Steve Ivy <[EMAIL PROTECTED]> wrote:
> >> Hello,
> >>
> >> I'm working on the front end for a JSF app, and I'm trying to add some
> >> interactivitiy to the interface via javascript. Typically you do a lot
> >> of:
> >>
> >> document.getElementById ('someId').etc ()
> >>
> >> But I find that setting the id in JSF usually results in something
> >> like id="content:_id35:nameHelp". I'm not sure how these ids are
> >> assigned, and I'm not sure how I can predict what id an element will
> >> have in order to acess it via javascript (or css for that matter, but
> >> that's another rant). Are there accepted methods of getting around
> >> this?
> >>
> >> Thanks,
> >>
> >> --Steve
> >>
> >> --
> >> Steve Ivy
> >> http://redmonk.net
> >>
> >
> >
>
>


--
Steve Ivy
http://redmonk.net

Reply via email to