GWT itself provides some basic WIDGET easy to interface development. Use these WIDGET can develop a very nice system, if your page can not WIDGET developed, if the more difficult times, can use the DOM tool, using tools you can use the HTML DOM syntax to draw the page. Can be completed by the graphic page design, developer, only need to use the DOM tool to carry out, the background of a number of treatment can be.
Such as Element userIdElement = DOM.getElementById ("userId"); so that I can get to the HTML, an element id as userId,
For example in the word, for example page has a login button, I now point the button to trigger the login time. Can do
DOM.sinkEvents (dengluElement, Event.ONCLICK);
public void onBrowserEvent (Event event) (
if (DOM.eventGetType (event) == Event.ONCLICK) (
String userId = userIdElement.getAttribute ("value");
String password = passwordElement.getAttribute ("value");
doLogin (userId, password);
Access to page elements by DOM.getElementById here can be any HTML element.
Then DOM.sinkEvents HTML elements to trigger events.
Finally, DOM.setEventListener adding event listeners.
I believe we should look to understand,