tags:

views:

471

answers:

1

I'm using a custom GWT component that wraps around an existing textbox in my html page.

The page returns a list of information - so as larger sets of information are loaded - the GWT loading process takes longer and longer.

Looking at the source code of the wrap() method - it appears it iterates through the DOM looking for matching ids.

Isn't this unnecessary? Is there a way to make it just iterate to my component and then stop?

+1  A: 

GWT does a bunch of DOM house keeping and you are just not going to get around it easily or at all.

It sounds like there's a point at which you have so many text inputs that you need to rethink how you're approaching this anyway. Dynamically creating inputs fields in a form panel in GWT is pretty easy and fast, and you can very simply and quickly download a json structure with the data you need for the input fields in your original html page load, convert it to a dictionary or simple array in GWT and , use it to populate your form.

Once done, you can clear the pointer to the data so it will GC'd if you don't need it any longer.

To access data in javascript look at creating a native method, its very easy to do. If it makes sense, you can format the json data as a dictionary and GWT's dictionary class will map directly to it.

I use these techniques all the time and they are robust and pretty much as fast as javascript can populate the DOM.

jottos