On 29 oct, 06:47, prads <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> There is a requirement in my application (which has been in
> development since a year) that every widget needs to be identified by
> a unique value. The reason,I am told, for this is that having a unique
> identifier for all the widgets will simply the automation of
> functional testing. The application has many screens with a lot of
> widgets - both custom and the ones provided by GWT. Also, the
> identifier for a particular widget needs to be same across multiple
> runs of the application.

Did you looked at ensureDebugId?
http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/UIObject.html#ensureDebugId(java.lang.String)

It has zero overhead when compiled "for production".

> I would like to have a solution which is easy to implement (dont want
> to change a lot of working code) and would not add much to the code
> base. One of the solutions could be modifying the constructors of all
> our custom widgets so that they would accept an identifier as a String
> which could then be added to the widget using DOM.setElementAttribute.
> But, this would involve changes in all the places where we are
> instantiating the widgets and will also require creating classes for
> those widgets which we are using directly from the GWT library.

You'd still have to go add ensureDebugId calls all over the place, but
you wouldn't have to "create classes for those widgets which [you] are
using directly from the GWT library".

In you custom widgets (probably Composite derivatives), you'll likely
override onEnsureDebugId to call it in turn on your widget's
"component widgets". This is what DialogBox, DisclosurePanel, MenuBar,
SuggestBox, TabPanel, Tree and TreeItem are already doing.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to