Revision: 9063
Author: [email protected]
Date: Thu Oct 14 11:10:19 2010
Log: Edited wiki page Editors through web user interface.
http://code.google.com/p/google-web-toolkit/source/detail?r=9063

Modified:
 /wiki/Editors.wiki

=======================================
--- /wiki/Editors.wiki  Mon Oct 11 12:49:32 2010
+++ /wiki/Editors.wiki  Thu Oct 14 11:10:19 2010
@@ -1,6 +1,6 @@
 #summary Data binding for bean-like objects

-= GWT Editor Framework (DRAFT) =
+= GWT Editor Framework =

The GWT Editor framework allows data stored in an object graph to be mapped onto a graph of Editors. The typical scenario is wiring objects returned from an RPC mechanism into a UI.

@@ -152,7 +152,7 @@
1 `setEditorDelegate()` is called, per `HasEditorDelegate` super-interface. 1 `setValue()` is called with the value that the Editor is responsible for editing. If the value will affect with sub-editors are or are not provided to the framework, they should be initialized or nullified at this time. 1 If `EditorDelegate.subscribe()` has been called, the Editor may receive subsequent calls to `onPropertyChange()` or `setValue()` at any point in time. - 1 `flush()` is called in a depth-first manner by the driver, so Editors generally do not flush their sub-Editors. + 1 `flush()` is called in a depth-first manner by the driver, so Editors generally do not flush their sub-Editors. Editors that directly mutate their peer object should do so only when `flush()` is called in order to allow an edit workflow to be canceled.

 === !CompositeEditor ===
`CompositeEditor` allows an unknown number of homogenous sub-Editors to be added to the Editor hierarchy at runtime. In addition to the behavior described for `ValueAwareEditor`, `CompositeEditor` has the following additional APIs:
@@ -209,7 +209,38 @@

   public LeafValueEditor<String> asEditor() {
     return wrapped.asEditor();
-  `
+  }
 }
 }}}
Similarly a `WorkgroupMembershipEditor` might implement `IsEditor<ListEditor<Person, PersonNameLabel>>`.
+
+=== Read-only Editors ===
+*Q:* Can I use Editors to view read-only data?
+
+*A:* Yes, just don't call the `flush()` method on the driver type. `RequestFactoryEditorDriver` has a convenience `display()` method as well.
+
+=== Very large objects ===
+*Q:* How can I edit objects with a large number of properties?
+
+*A:* An Editor doesn't have to edit all of the properties of its peer domain object. If you had a `BagOfState` type with many properties, it might make sense to write several Editor types that edit conceptually-related subsets of the properties:
+{{{
+class BagOfStateBiographicalEditor implements Editor<BagOfState> {
+  AddressEditor address;
+  Label name;
+}
+
+class BagOfStateUserPreferencesEditor implements Editor<BagOfState> {
+  CheckBox likesCats;
+  CheckBox likesDogs;
+}
+}}}
+Whether or not these editors are displayed all at the same time or sequentially is a user experience issue. The Editor framework allows multiple Editors to edit the same object:
+{{{
+class HasBagOfStateEditor implements Editor<HasBagOfState> {
+ @Editor.Path("state")
+ BagOfStateBiographicalEditor bio;
+
+ @Editor.Path("state")
+ BagOfStateUserPreferencesEditor prefs;
+}
+}}}

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to