[Cosmo-dev] Getting a handle on specific UI elements

Matthew Eernisse mde at osafoundation.org
Mon Dec 11 13:27:39 PST 2006


More comments inline ...

Bobby Rullo wrote:
> Yeah, I don't think we should get too clever about figuring out the 
> parent widget or whatever, my reasoning is that if you change the 
> implementation (maybe have a different widget hierarchy or something) 
> your id's all change, even though nothing changed to the user. And then 
> Adam comes over complaining.

This is a valid point, although it seems pretty likely to me that 
changes in the actual widget hierarchy would only be driven by real 
changes in the UI -- after all, the JS namespace for a widget just 
reflects its logical position in the UI -- e.g., 
app.modalDialog.buttonPanel.

And I think that'd be pretty much the same with whatever 
'namespace-like' ids you'd be setting with those long strings.

> If you just have a String set, you set it once and forget about it forever.

So it doesn't sound like this is a simple, randomly generated String.

It sounds like y'all are talking about some kind of logical namespace 
that would also need to be kept up-to-date as the UI code evolves -- 
otherwise you eventually end up with paths to UI elements that don't 
really reflect what's going on in the actual UI anymore.

> Btw - I am 99% sure that if you give something a widget id, that also 
> becomes the DOM id.

I see conflicting stuff on the mailing lists, including this:

http://dojotoolkit.org/pipermail/dojo-interest/2006-November/021746.html

The IBM tutorial they quote seems to say it's *supposed* to map the main 
domNode id to the widgetId automagically. However, I did a minimal 
widget test:

http://www.fleegix.org/demo/minimal/widget_test.html

And neither declarative widgets nor programmatic widgets get an id for 
the domNode unless I manually stick it into the template. Could be I'm 
screwing something up. :)


Matthew




More information about the cosmo-dev mailing list