Re: How to clear fields of editors?

2012-11-02 Thread Jens
Just searched a bit and I think the post in question was https://groups.google.com/d/msg/google-web-toolkit/aemVcEjK_5I/7VISroJi2VcJ But if its seems to be solved since GWT 2.3 it should be fine to reuse the editor driver. -- J. Am Freitag, 2. November 2012 03:30:36 UTC+1 schrieb Thomas

Re: How to clear fields of editors?

2012-11-02 Thread Drew Spencer
Thanks guys! I think I will call edit() on a new instance, as this is a nice way of doing it. Also, are there significant benefits to re-using an editor? Mine is declared as final at the top of my view, then in edit() I am calling driver.initialize() and then driver.edit(object). That means

Re: How to clear fields of editors?

2012-11-02 Thread Thomas Broyer
Yes and no. You only need to call initialize() once. -- 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/-/mOoij-EcmNgJ. To post to this group, send

Re: How to clear fields of editors?

2012-11-02 Thread Ümit Seren
This is how I usually do it (not sure if this is the best approach). In my View: public class AccountDetailView { public interface AccountDisplayDriver extends RequestFactoryEditorDriverAccountProxy, AccountDisplayEditor {} @UiField AccountDisplayEditor accountDisplayEditor;

How to clear fields of editors?

2012-11-01 Thread Drew Spencer
Hi coders, I have recently implemented some editors in my app, and am planning on using them for all editing of beans from now on. For each object (say Account, for example) I have an EditAccountPresenter, which can be used to a) create a new Account from scratch, or b) edit the details of an

Re: How to clear fields of editors?

2012-11-01 Thread Drew Spencer
Forgot to ask... is calling edit(new Account()) an acceptable way to do this? Thanks On Thursday, 1 November 2012 15:35:34 UTC, Drew Spencer wrote: Hi coders, I have recently implemented some editors in my app, and am planning on using them for all editing of beans from now on. For each

Re: How to clear fields of editors?

2012-11-01 Thread Jens
When you want to edit a new instance (regardless if its an empty instance or not) you would create a new editor driver and call edit() with the new instance. As the editor graph represents more or less your object graph this should be enough to update the Ui. If the instance is empty the Ui

Re: How to clear fields of editors?

2012-11-01 Thread Thomas Broyer
On Thursday, November 1, 2012 6:10:58 PM UTC+1, Jens wrote: When you want to edit a new instance (regardless if its an empty instance or not) you would create a new editor driver and call edit() with the new instance. As the editor graph represents more or less your object graph this

Re: How to clear fields of editors?

2012-11-01 Thread Jens
+1 except you don't have to create a new editor driver, you can reuse a previously built one. Wasn't there a memory leak somewhere in the editor framework when you reuse the driver? That was somewhere in my head while answering. But maybe its already solved. -- J. -- You received this

Re: How to clear fields of editors?

2012-11-01 Thread Thomas Broyer
On Thursday, November 1, 2012 7:45:30 PM UTC+1, Jens wrote: +1 except you don't have to create a new editor driver, you can reuse a previously built one. Wasn't there a memory leak somewhere in the editor framework when you reuse the driver? That was somewhere in my head while