<ui:UiBinder
xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'>
<g:FlowPanel>
<g:Label>Login is required</g:Label>
<g:TextBox ui:field='userIdTextBox'>User ID</g:TextBox>
<g:PasswordTextBox ui:field='passwordTextBox'>Password</g:PasswordTextBox>
<g:Button ui:field='okButton'>OK</g:Button>
</g:FlowPanel>
</ui:UiBinder>
In the Java source file (LoginWidget.java) I create the UiBinder object in the LoginWidget constructor using:
ILoginWidgetBinder = GWT.create(ILoginWidgetBinder.class);
setWidget(binder.createAndBindUi(this));
When I want to display the login request screen I call the "login()" method:
public void login() {
setGlassEnabled(true);
show();
center();
}
When the "OK" button is clicked and a response received from the server to the login credentials the "onSuccess()" method executes the "hide()" method to hide the login widget.