I am beginning programmer, learning GWT, the first link on request
"GWT forum" led here, so I decided to ask here. English is not my
native language, but I hope that you will understand the essence.
Individually each simple Editor successfully stored in the database:
(http://pastebin.com/S2UrzAGG)
BaseEditor extends LayoutPanel implements Editor<OrderProxy> {
private OrderPresenter<ClientProxy> listener;
protected void saveButtonClick() {
listener.persist();
}
}
public class OrderClientActivity implements Activity, OrderPresenter {
private OrderClientWorkArea view;
private OrderClientDriver driver; // public interface
OrderClientDriver extends RequestFactoryEditorDriver<OrderProxy,
OrderClientEditor>
private OrderProxy currentItem; // public interface OrderProxy
extends EntityProxy
private OrderServiceRF currentContext; // public interface
OrderServiceRF extends RequestContext
public void persist() {
driver.flush();
currentContext.persist(currentItem).fire(new
Receiver<OrderProxy>() {
@Override
public void onSuccess(OrderProxy response) {
History.back();
}
});
}
public void start(AcceptsOneWidget panel, EventBus eventBus) {
driver = GWT.create(OrderClientDriver.class);
driver.initialize(view.getEditor());
currentContext =
clientFactory.getEdocRequestFactory().getOrderService();
final OrderServiceRF service =
clientFactory.getEdocRequestFactory().getOrderService();
service.getAll().with( driver.getPaths() ).fire(new
Receiver<List<OrderProxy>>() {
@Override
public void onSuccess(List<OrderProxy> response) {
itemEditCurrent(response);
}
});
}
protected void itemEditCurrent(List<OrderProxy> items) {
currentItem = findItemById(id,items);
view.showEditor(true);
driver.edit(currentItem, currentContext);
}
}
I want dynamically add Sub-Editors, for example on VerticalPanel, some
Sub-Editors have CellTable with a list of related objects, and I can
edit Sub-Editors fields and theys CellTable. How to do that when I
clicked the "Save" button on Top-Level Editor all changes save to
database?
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment