Re: How to wire multiple editor to same bean.
In trying Daniel's approach, I have a primary view class CompanyView implementing Editor<Company>. It has several child AddressView objects, which implement Editor<Address>; there are several Address fields in the Company. They get populated without my AddressView class ever invoking driver.edit or driver.flush (and I don't seem to need any set or getValue methods). But, that's just an aside.
I then created a sub-editor PurchasingView also implementing Editor<Company>, since the related data is in single fields within Company, instead of a sub-object.
@UiField @Editor.Path("")
PurchasingView purchasingView;
I assumed that the PurchasingView should define and GWT.create it's own driver interface, and that it's constructor should initialize that driver.
When the time comes to edit the Company in the outer view in DevMode, or when I compile, I get the following error:
Type mismatch: cannot convert from Company to String
It refers me to some generated code, which begins with:
public class PurchasingView__Context extends com.google.gwt.editor.client.impl.AbstractEditorContext<java.lang.String> {
And, as you might imagine, the methods it contains relate to String, not Company.
I don't currently have get/setValue, but tried those as well, assuming that getValue ought to return driver.flush(), and setValue(Company value) ought to do driver.edit(value) - needless to say, that didn't help
What am I missing here to get it to recognize that it should be editing a Company, not a String?
On Wednesday, April 18, 2012 12:17:06 PM UTC-4, Thomas Broyer wrote:
-- I then created a sub-editor PurchasingView also implementing Editor<Company>, since the related data is in single fields within Company, instead of a sub-object.
@UiField @Editor.Path("")
PurchasingView purchasingView;
I assumed that the PurchasingView should define and GWT.create it's own driver interface, and that it's constructor should initialize that driver.
When the time comes to edit the Company in the outer view in DevMode, or when I compile, I get the following error:
Type mismatch: cannot convert from Company to String
It refers me to some generated code, which begins with:
public class PurchasingView__Context extends com.google.gwt.editor.client.impl.AbstractEditorContext<java.lang.String> {
And, as you might imagine, the methods it contains relate to String, not Company.
I don't currently have get/setValue, but tried those as well, assuming that getValue ought to return driver.flush(), and setValue(Company value) ought to do driver.edit(value) - needless to say, that didn't help
What am I missing here to get it to recognize that it should be editing a Company, not a String?
On Wednesday, April 18, 2012 12:17:06 PM UTC-4, Thomas Broyer wrote:
On Wednesday, April 18, 2012 5:49:56 PM UTC+2, saurabh saurabh wrote:Hi all,
I don't have much experience with Editor frameworks so this question
may appear naive or dumb.
So suppose we have a big bean or proxy having a many fields. A good
idea in view part could be having group them under TabLayoutPanel
otherwise a big form on a page may not appear user friendly.
Example:
Patient Registration Form
------------------------------------------------------------ ------------------------------ ------------------------------ ---
||Personal Details || Patient Habbits || Family History || Medical
History || Insurance || |
------------------------------------------------------------ ------------------------------ ------------------------------ ---
|
|
|
|
|
------------------------------------------------------------ ------------------------------ ------------------------------ ---
Here I feel comfortable to have five different UI like detailsView,
habbitsView and so on and having them under one composite but all of
'em are concerned to one Class Patient.
So my question is how I can wire multiple Editors to same bean, each
for different set of properties.
I don't find much on net for Editors, I guess it could be
CompositeEditors, but I need some help for how to do it.See https://developers.google.com/web-toolkit/doc/latest/ (and note that you can use @Path("") to have a subeditor for the same object as is being edited).DevGuideUiEditors#Very_large_ objects Alternatively, you can use several EditorDrivers on the same object; you'd just have to make sure they don't step on each others (that is, you don't edit the same field in two distinct EditorDrivers). The only difference is that you can edit() the object only when needed (e.g. when the tab is first revealed), but you'll have to flush() all the drivers that you called edit() on before saving your object, or you risk losing data (not persisting changes made by the user).
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home