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

Travis Vachon travis at osafoundation.org
Fri Dec 8 09:52:18 PST 2006


>
>
> My idea is fairly simple: give id's to all widgets/UI elements in a  
> consistent, namespaced way, eg "detailPanel.CancelButton"
+1

This is very easy to implement in our widget code, and really only  
requires developers to make sure they're careful to provide a  
widgetId whenever they create a widget, which they should anyway.

To make sure subwidgets get the correct ids, developers could either  
be diligent to make them of the form "${this.widgetId}.awesomeButton"  
OR we could put a little logic in that finds the parent widget.

Personally, I actually like option 1 better. For a little extra work  
at the time developers write widget creation code/templates, ids are  
more explicit in our code/templates, and we don't lose the  
flexibility to set widgetIds to whatever we want.

-Travis


More information about the cosmo-dev mailing list