Skip to content

Instantly share code, notes, and snippets.

@amaltson
Created November 6, 2010 19:39
Show Gist options
  • Save amaltson/665655 to your computer and use it in GitHub Desktop.
Save amaltson/665655 to your computer and use it in GitHub Desktop.
The UiBinder for editing Customers.
public class CustomerEditor extends Composite implements Editor<Customer> {
private static CustomerEditorUiBinder uiBinder = GWT
.create(CustomerEditorUiBinder.class);
interface CustomerEditorUiBinder extends UiBinder<Widget, CustomerEditor> {
}
@UiField
TextBox firstName;
@UiField
TextBox lastName;
@UiField
AddressEditor addressEditor;
@UiField
EmailEditor emailEditor;
public CustomerEditor() {
initWidget(uiBinder.createAndBindUi(this));
}
}
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:d="urn:import:org.gwtexperiments.client.binding">
<ui:style>
</ui:style>
<g:HTMLPanel>
<h3>Customer</h3>
<div>
First Name:
<g:TextBox ui:field="firstName" />
</div>
<div>
Last Name:
<g:TextBox ui:field="lastName" />
</div>
<div>
Address
<d:AddressEditor ui:field="addressEditor" />
</div>
<div>
Email
<d:EmailEditor ui:field="emailEditor" />
</div>
</g:HTMLPanel>
</ui:UiBinder>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment