Re: Editor not flush values of subeditors
The error is when I declare an interface instead of a particular class implementation. By example: @UiField(provided = true) AddressView address; //Interface (not a concrete class) Note that into file ui.xml the inclusion of widget also is a interface by example: l:AddressView ui:field=address/l:AddressView Now, when inject AddressView by constructor in the container view (TerceroNewEditor), and I asign the variable before that uibinder make a interface, aren't because Editor do not send values contained inside the AddressView. Now, if I only change the declaration: @UiField(provided = true) AddressView address; by @UiField(provided = true) AddressEditor address; //implementation of AddressView and either way that I assign (injection or direct creation), Editor works well. This is an error or is not covered? Thanks and please, sorry for my english!! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/fcFfyRmlb1cJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Editor not flush values of subeditors
What is AddressView is extending? On Thu, Oct 27, 2011 at 6:25 PM, Cristian Rinaldi csrina...@gmail.comwrote: The error is when I declare an interface instead of a particular class implementation. By example: @UiField(provided = true) AddressView address; //Interface (not a concrete class) Note that into file ui.xml the inclusion of widget also is a interface by example: l:AddressView ui:field=address/l:AddressView Now, when inject AddressView by constructor in the container view (TerceroNewEditor), and I asign the variable before that uibinder make a interface, aren't because Editor do not send values contained inside the AddressView. Now, if I only change the declaration: @UiField(provided = true) AddressView address; by @UiField(provided = true) AddressEditor address; //implementation of AddressView and either way that I assign (injection or direct creation), Editor works well. This is an error or is not covered? Thanks and please, sorry for my english!! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/fcFfyRmlb1cJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- Christian Goudreau www.arcbees.com -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Editor not flush values of subeditors
If AddressView is neither an Editor nor an IsEditor, that's the expected behavior, as I told you before. The generator for the EditorDriver can only looks at the declared type of the fields and declared return types of the methods, if AddressView is not an editor, then the field will smply be ignored by the Editor framework. It really doesn't matter what the field value is exactly (well, actually, most –if not all– subinterfaces of Editor are dealt with at runtime, provided the field's type extends/implements Editor to begin with), or when it's initialized/assigned. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/D32nDAL3UfUJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Editor not flush values of subeditors
Hello Christian: AddressView extends View and EditorAddressProxy See below: public interface AddressView extends View, EditorAddressProxy{ public interface Presenter extends MutablePresenterAddressView{ } } -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/HNhboah3MP8J. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Editor not flush values of subeditors
Similarly, if AddressView has no subeditors (zero-arg methods with an Editor/IsEditor return type), it's basically useless. Keep in mind that the generator looks at your classes, not the actual instances: it runs at compile-time to generate code. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/VwJffl9VuF8J. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Editor not flush values of subeditors
Thanks thomas, I see it clearly now. It's a shame, I wanted the container interface does not depend on the particular implementation of Address. If this changes, I just wanted to change the bind in GIN. Thanks.! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/vgdUNdeI7O0J. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Editor not flush values of subeditors
On Tuesday, October 25, 2011 10:33:55 PM UTC+2, Cristian Rinaldi wrote: Thomas, thanks for the fast responce. I will see if this is causing the error. AddressWidget implements AddressView and Editor for AddressProxy, you say that the AddressView must be extend Editor? I'm saying that the type of the address field in type TerceroEditor does not implement Editor (or IsEditor), so the Editor framework does not treat it as an editor. You'll either have to change it to AddressWidget, or make AddressView extend Editor. Now, one design question. I love MVP, this pattern is very powerfull but, with Activities and Place some thing are dificult. Activities are for when you need navigation, but if want each view has a Presenter, I thought the following: One interface Presenter for each View, where View delegate the logic in the presenter implementation. Now, presenter is not Activity. When I need navigation, I make a Activity that inject the presenter and delegate in this the logic of View. I want keep separate in the best forms the concepts of view and presenter, but I want to know if inject the presenter in view is ok. The presenter have a method called onCreate(T) where T is a View. That method is called when View is initialized after make UiBinder interface. In the onCreate(T) I inicialize the editor driver, etc. When I precise a Activity, in the start method I obtain the view, by example, with AsyncProvider, how the View inject Presenter, the Activity delegate logic to Presenter. I started think this for nested complex widget, for example, load Employees associated with bank accounts, where the Widgets for list of selection and creation bank account is a widget that delegate logic in a presenter that is not Activity. But, i can use this widget alone in other view where is necesary one Activity. All this is fine or I've gone crazy? I'm not sure I understood what you're coming with. All I can say is that my activities are presenters, and in a few cases where a complex component is to be reused, I have a presenter and view for it that's not an activity. I also inject my views within my presenters in their constructors, and the presenters inject themselves into their view when needed (when the activity starts, in my case); this allows the views to have longer lifetime as the presenters, because I use short-lived presenters and singleton views. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/bmgNK-epWLoJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Editor not flush values of subeditors
Tanks Thomas for response. The rare is that AddressView implements EditorAddreessProxy I put the codes below: *Extract for TerceroNewView* public interface TerceroNewView extends View, EditorTercerosProxy { public interface Presenter extends MutablePresenterTerceroNewView{ } RequestFactoryEditorDriverTercerosProxy, ? extends EditorTercerosProxy createEditorDriver( RequestFactory rf); } * * * * *Extract for TerceroEditor* public class TerceroEditor implements TerceroNewView { private static TerceroEditorUiBinder uiBinder = GWT.create(TerceroEditorUiBinder.class); interface TerceroEditorUiBinder extends UiBinderSimplePanel, TerceroEditor { } interface Driver extends RequestFactoryEditorDriverTercerosProxy, TerceroEditor { } private SimplePanel root; @UiField ClientResource res; @UiField ValueBoxEditorDecoratorString name; @UiField ValueBoxEditorDecoratorString lastName; @UiField(provided = true) AddressView address; private final TerceroNewView.Presenter presenter; @Inject public TerceroEditor( AsyncProviderAddressView addressView, @Named(Constans.TerceroNewPresenter) TerceroNewView.Presenter presenter) { this.presenter = presenter; addressView.get(new AsyncCallbackAddressView() { @Override public void onSuccess(AddressView result) { address = result; ini(); } @Override public void onFailure(Throwable caught) { } }); } private void ini(){ root = uiBinder.createAndBindUi(this); res.erpLgkStyle().ensureInjected(); presenter.onCreate(this); } . . } *Extract for AddressView:* public interface AddressView extends View, EditorAddressProxy{ public interface Presenter extends MutablePresenterAddressView{ } HasConstrainedValueCityProxy getCitys(); } *Extract for AddressEditor:* public class AddressEditor implements AddressView { interface AddressWidgetUiBinder extends UiBinderHTMLPanel, AddressEditor { } interface Driver extends RequestFactoryEditorDriverAddressProxy, AddressEditor { } private static AddressWidgetUiBinder uiBinder = GWT.create(AddressWidgetUiBinder.class); private HTMLPanel root; private AddressView.Presenter presenter; @UiField ValueBoxEditorDecoratorString address; @UiField ValueBoxEditorDecoratorInteger number; @UiField ValueBoxEditorDecoratorString code; @UiField(provided = true) SelectorCityView city; @Inject public AddressEditor( AsyncProviderSelectorCityView selectorCity, @Named(Constans.AddressNewPresenter) AddressView.Presenter presenter) { this.presenter = presenter; // TODO ver si hay otra forma de inicializar las vistas selectorCity.get(new AsyncCallbackSelectorCityView() { @Override public void onSuccess(SelectorCityView result) { city = result; init(); } @Override public void onFailure(Throwable caught) { } }); } private void init(){ root = uiBinder.createAndBindUi(this); presenter.onCreate(this); } ... ... } *Extract for TerceroNewPresenter* public class TerceroNewEditorPresenter implements TerceroNewView.Presenter { private final PlaceController placeController; private final ErpRequestFactory requestFactory; private RequestFactoryEditorDriverTercerosProxy, ? extends EditorTercerosProxy terceroDriver; @Inject public TerceroNewEditorPresenter(final AddressNewPresenter addressPresenter, final ErpRequestFactory requestFactory, final PlaceController placeController) { this.placeController = placeController; this.requestFactory = requestFactory; } @Override public void goTo(Place place) { placeController.goTo(place); } @Override public void save() { RequestContext context = terceroDriver.flush(); boolean hasClientErrors = terceroDriver.hasErrors(); if (!hasClientErrors) { context.fire(new ReceiverVoid() { @Override public void onSuccess(Void response) { placeController.goTo(new DefaultPlace()); } @Override public void onViolation(SetViolation errors) { terceroDriver.setViolations(errors); } @Override public void onConstraintViolation(SetConstraintViolation? violations) { terceroDriver.setConstraintViolations(violations); } }); } } @Override public void onCreate(final TerceroNewView view) { terceroDriver = view.createEditorDriver(requestFactory); TercerosRequest context = requestFactory.getTercerosRequest(); TercerosProxy tercero = context.create(TercerosProxy.class); AddressProxy address = context.create(AddressProxy.class); tercero.setAddress(address); context.persist(tercero).with(terceroDriver.getPaths()); terceroDriver.edit(tercero, context); } ... ... } *Extract for GIN configurations:*
Re: Editor not flush values of subeditors
To test I created a new view for Address without presenter injected into constructor. And the Address View is not injected into the TerceroEditor view. And things are just fine. This works well: @UiField AddressEditor2 address; *//AddressEditor is a concrete class.* private final TerceroNewView.Presenter presenter; @Inject public TerceroEditor( *//Note: not inject sub-view AddressView, UiBinder make a implementation* @Named(Constans.TerceroNewPresenter) TerceroNewView.Presenter presenter) { this.presenter = presenter; ini(); } private void ini(){ root = uiBinder.createAndBindUi(this); res.erpLgkStyle().ensureInjected(); presenter.onCreate(this); } TerceroNewEditor.ui.xml part: ... ... l:AddressEditor2 ui:field=address/l:AddressEditor2 ... ... //AddressView implements EditorAddressProxy public class AddressEditor2 extends Composite implements AddressView { private static AddressEditor2UiBinder uiBinder = GWT.create(AddressEditor2UiBinder.class); interface AddressEditor2UiBinder extends UiBinderWidget, AddressEditor2 { } private HTMLPanel root; private AddressView.Presenter presenter; @UiField ValueBoxEditorDecoratorString address; @UiField ValueBoxEditorDecoratorInteger number; @UiField ValueBoxEditorDecoratorString code; public AddressEditor2() { initWidget(uiBinder.createAndBindUi(this)); } } * - * * - * * * If you inject the View with a Provider or AsyncProvider or directly not send the information of Address. This does not work: @ UiField (provided = true) AddressView address *//AddressView is a interface that Implements EditorAddressProxy* private final TerceroNewView.Presenter presenter; @Inject public TerceroEditor( *ProviderAddressView addressView,* @Named(Constans.TerceroNewPresenter) TerceroNewView.Presenter presenter) { * this.address = addressView.get();* this.presenter = presenter; ini(); } private void ini(){ root = uiBinder.createAndBindUi(this); res.erpLgkStyle().ensureInjected(); presenter.onCreate(this); } TerceroNewEditor.ui.xml part: ... ... l:AddressView ui:field=address/l:AddressView ... ... //AddressView implemens EditorAddressProxy public class AddressEditor implements AddressView { interface AddressWidgetUiBinder extends UiBinderHTMLPanel, AddressView { } private static AddressWidgetUiBinder uiBinder = GWT.create(AddressWidgetUiBinder.class); private HTMLPanel root; private AddressView.Presenter presenter; @UiField ValueBoxEditorDecoratorString address; @UiField ValueBoxEditorDecoratorInteger number; @UiField ValueBoxEditorDecoratorString code; @Inject public AddressEditor( @Named(Constans.AddressNewPresenter) AddressView.Presenter presenter) { this.presenter = presenter; init(); } private void init(){ root = uiBinder.createAndBindUi(this); presenter.onCreate(this); } @Override public Widget asWidget() { return root; } } *Gin Module* * * public class ViewModule extends AbstractGinModule { @Override protected void configure() { *bind(AddressView.class).to(AddressEditor.class).in(Singleton.class);* * bind(TerceroNewView.class).to(TerceroEditor.class).in(Singleton.class); * . . * bind(TerceroNewView.Presenter.class).annotatedWith(Names.named(Constans.TerceroNewPresenter)).to(TerceroNewEditorPresenter.class); * * bind(AddressView.Presenter.class).annotatedWith(Names.named(Constans.AddressNewPresenter)).to(AddressNewPresenter.class); * } } A.U.S Cristian Rinaldi Teléfono Móvil: (0342) 155 238 083 www.logikas.com Lisandro de la Torre 2643 Of 5 - 3000 - Santa Fe Teléfono Fijo: (0342) 483 5138 2011/10/26 Cristian Rinaldi cristian.rina...@logikas.com Tanks Thomas for response. The rare is that AddressView implements EditorAddreessProxy I put the codes below: *Extract for TerceroNewView* public interface TerceroNewView extends View, EditorTercerosProxy { public interface Presenter extends MutablePresenterTerceroNewView{ } RequestFactoryEditorDriverTercerosProxy, ? extends EditorTercerosProxy createEditorDriver( RequestFactory rf); } * * * * *Extract for TerceroEditor* public class TerceroEditor implements TerceroNewView { private static TerceroEditorUiBinder uiBinder = GWT.create(TerceroEditorUiBinder.class); interface TerceroEditorUiBinder extends UiBinderSimplePanel, TerceroEditor { } interface Driver extends
Editor not flush values of subeditors
Hello: I am working in a project with GWT (RF, Editors, MVP). I have an error with bind of Editor The error itself, is that address property is not sent, not sent values with flush is called in method save of *TerceroNewEditorPresenter*. The unique values that are sent, are those that correspond to *Tercero (name and lastName). * Attached files to see and guide me in the error. Thank you very much and sorry for my English. A.U.S Cristian Rinaldi Teléfono Móvil: (0342) 155 238 083 www.logikas.com Lisandro de la Torre 2643 Of 5 - 3000 - Santa Fe Teléfono Fijo: (0342) 483 5138 -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. /** * */ package com.logikas.erp.client.ui; import com.google.gwt.user.client.ui.HasConstrainedValue; import com.logikas.erp.client.activity.presenter.MutablePresenter; import com.logikas.erp.shared.proxy.CityProxy; /** * Package: com.logikas.erp.client.ui * File:AddressView.java * Date:11/10/2011 * * @autor cristian - Logikas Conectando Ideas */ public interface AddressView extends View{ public interface Presenter extends MutablePresenterAddressView{ } HasConstrainedValueCityProxy getCitys(); } /** * */ package com.logikas.erp.client.ui; import com.google.gwt.editor.client.Editor; import com.google.gwt.editor.client.IsEditor; import com.google.gwt.user.client.ui.HasConstrainedValue; import com.logikas.erp.client.activity.presenter.NavigationPresenter; import com.logikas.erp.shared.proxy.CityProxy; /** * Package: com.logikas.erp.client.ui * File:SelectorCityView.java * Date:11/10/2011 * * @autor cristian - Logikas Conectando Ideas */ public interface SelectorCityView extends IsEditorEditorCityProxy, View{ public interface Presenter extends NavigationPresenterSelectorCityView{} HasConstrainedValueCityProxy getListCity(); } /** * */ package com.logikas.erp.client.ui; import com.google.gwt.editor.client.Editor; import com.google.web.bindery.requestfactory.gwt.client.RequestFactoryEditorDriver; import com.google.web.bindery.requestfactory.shared.RequestFactory; import com.logikas.erp.client.activity.presenter.MutablePresenter; import com.logikas.erp.shared.proxy.TercerosProxy; /** * Package: com.logikas.erp.client.ui File: TerceroView.java Date: 11/10/2011 * * Representa el formulario de carga de la informacion asociada a un tercero * * @autor cristian - Logikas Conectando Ideas */ public interface TerceroNewView extends View { public interface Presenter extends MutablePresenterTerceroNewView{ } AddressView getAddressView(); RequestFactoryEditorDriverTercerosProxy, ? extends EditorTercerosProxy createEditorDriver( RequestFactory rf); } /** * */ package com.logikas.erp.client.ui; import com.google.gwt.user.client.ui.IsWidget; /** * Package: com.logikas.erp.client.ui File: View.java Date: 03/10/2011 * * @autor cristian - Logikas Conectando Ideas */ public interface View extends IsWidget { } /** * */ package com.logikas.erp.client.ui.impl; import com.google.gwt.core.client.GWT; import com.google.gwt.editor.client.Editor; import com.google.gwt.editor.ui.client.ValueBoxEditorDecorator; import com.google.gwt.inject.client.AsyncProvider; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.HTMLPanel; import com.google.gwt.user.client.ui.HasConstrainedValue; import com.google.gwt.user.client.ui.Widget; import com.logikas.erp.client.Constans; import com.logikas.erp.client.ui.AddressView; import com.logikas.erp.client.ui.SelectorCityView; import com.logikas.erp.shared.proxy.AddressProxy; import com.logikas.erp.shared.proxy.CityProxy; import javax.inject.Inject; import javax.inject.Named; /** * Package: com.logikas.erp.client.ui.impl File: AddressWidget.java Date: 11/10/2011 * * @autor cristian - Logikas Conectando Ideas */ public class AddressEditor implements AddressView, EditorAddressProxy { private static AddressWidgetUiBinder uiBinder = GWT.create(AddressWidgetUiBinder.class); private HTMLPanel root; private AddressView.Presenter presenter; @UiField ValueBoxEditorDecoratorString address; @UiField ValueBoxEditorDecoratorInteger number; @UiField ValueBoxEditorDecoratorString code; @UiField(provided = true) SelectorCityView city; interface AddressWidgetUiBinder extends UiBinderHTMLPanel, AddressEditor { } @Inject public AddressEditor( AsyncProviderSelectorCityView selectorCity, @Named(Constans.AddressNewPresenter) AddressView.Presenter
Re: Editor not flush values of subeditors
AddressView (which is the type used in TerceroEditor) extends neither Editor nor IsEditor, so the address property isn't edited. Did I miss something in your code? (I only looked at TerceroNewEditorPresenter, TerceroEditor and AddressView) -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/4IBCIS36iCwJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Editor not flush values of subeditors
Thomas, thanks for the fast responce. I will see if this is causing the error. AddressWidget implements AddressView and Editor for AddressProxy, you say that the AddressView must be extend Editor? Now, one design question. I love MVP, this pattern is very powerfull but, with Activities and Place some thing are dificult. Activities are for when you need navigation, but if want each view has a Presenter, I thought the following: One interface Presenter for each View, where View delegate the logic in the presenter implementation. Now, presenter is not Activity. When I need navigation, I make a Activity that inject the presenter and delegate in this the logic of View. I want keep separate in the best forms the concepts of view and presenter, but I want to know if inject the presenter in view is ok. The presenter have a method called onCreate(T) where T is a View. That method is called when View is initialized after make UiBinder interface. In the onCreate(T) I inicialize the editor driver, etc. When I precise a Activity, in the start method I obtain the view, by example, with AsyncProvider, how the View inject Presenter, the Activity delegate logic to Presenter. I started think this for nested complex widget, for example, load Employees associated with bank accounts, where the Widgets for list of selection and creation bank account is a widget that delegate logic in a presenter that is not Activity. But, i can use this widget alone in other view where is necesary one Activity. All this is fine or I've gone crazy? Sorry for my english. A.U.S Cristian Rinaldi Teléfono Móvil: (0342) 155 238 083 www.logikas.com Lisandro de la Torre 2643 Of 5 - 3000 - Santa Fe Teléfono Fijo: (0342) 483 5138 2011/10/25 Thomas Broyer t.bro...@gmail.com AddressView (which is the type used in TerceroEditor) extends neither Editor nor IsEditor, so the address property isn't edited. Did I miss something in your code? (I only looked at TerceroNewEditorPresenter, TerceroEditor and AddressView) -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.