base.getFlexCellFormatter().setColSpan(2, 0, 2);
base.setWidget(3, 0, notes);
base.getFlexCellFormatter().setColSpan(3, 0, 2);
p.add(base);
p.add(new Label("Addresses:"));
addressCols[0] = new Field("type", "Type");
addressCols[1] = new Field("address1", "Address");
addressCols[2] = new Field("address2", "");
addressCols[3] = new Field("city", "City");
addressCols[4] = new Field("state", "State");
addressCols[5] = new Field("zip", "Zip");
factory.add(StateLookup.class,
new BoundWidgetProvider() {
public BoundWidget get() {
Label label = new Label();
label.setRenderer(new Renderer() {
public Object render(Object o) {
return (o == null) ? "" : ((StateLookup) o).code;
}
});
return label;
}
});
factory.add(TypeLookup.class,
new BoundWidgetProvider() {
public BoundWidget get() {
TextBox label = new TextBox();
label.setRenderer(new Renderer() {
public Object render(Object o) {
return (o == null) ? "" : ((TypeLookup) o).name;
}
});
return label;
}
});
factory.add(String.class, BoundWidgetTypeFactory.LABEL_PROVIDER);
factory.add(Address.class,
new BoundWidgetProvider() {
public BoundWidget get() {
AddressEdit e = new AddressEdit();
e.setAction(new AddressEditAction());
return e;
}
});
addresses = new BoundTable(BoundTable.HEADER_MASK +
BoundTable.SORT_MASK + BoundTable.NO_SELECT_CELL_MASK +
BoundTable.NO_SELECT_COL_MASK//+ BoundTable.MULTIROWSELECT_MASK
+ BoundTable.INSERT_WIDGET_MASK, factory);
addresses.setColumns(addressCols);
addresses.setWidth("500px");
p.add(addresses);
p.add(this.newAddress);
p.add(new Label("Phone Numbers: "));
phoneCols[0] = new Field("type", "Type");
phoneCols[1] = new Field("number", "Number");
BoundWidgetTypeFactory phoneFactory = new BoundWidgetTypeFactory(true);
phoneFactory.add(TypeLookup.class, TypeSelectorProvider.INSTANCE);
this.phoneNumbers = new BoundTable(BoundTable.HEADER_MASK +