|
GWT 2.7.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.google.gwt.uibinder.client.LazyDomElement<T>
T - the Element type associatedpublic class LazyDomElement<T extends Element>
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 | |
|---|---|
LazyDomElement(java.lang.String domId)
Creates an instance to fetch the element with the given id. |
|
| Method Summary | |
|---|---|
T |
get()
Returns the dom element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LazyDomElement(java.lang.String domId)
| Method Detail |
|---|
public T get()
java.lang.RuntimeException - if the element cannot be found
|
GWT 2.7.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||