Package com.google.gwt.uibinder.client
Class LazyDomElement<T extends Element>
java.lang.Object
com.google.gwt.uibinder.client.LazyDomElement<T>
- Type Parameters:
T
- the Element type associated
Wraps a call to a DOM element. LazyDomElement can boost performance of html
elements and delay calls to getElementById() to when the element is actually
used. But note that it will throw a RuntimeException in case the element is
accessed but not yet attached in the DOM tree.
Usage example:
Template:
<gwt:HTMLPanel> <div ui:field="myDiv" /> </gwt:HTMLPanel>
Class:
@UiField LazyDomElement<DivElement> myDiv; public setText(String text) { myDiv.get().setInnerHtml(text); }
-
Constructor Summary
ConstructorDescriptionLazyDomElement
(String domId) Creates an instance to fetch the element with the given id. -
Method Summary
-
Constructor Details
-
LazyDomElement
Creates an instance to fetch the element with the given id.
-
-
Method Details
-
get
Returns the dom element.- Returns:
- the dom element
- Throws:
RuntimeException
- if the element cannot be found
-