Correct usage of CompositeEditor?

450 views
Skip to first unread message

billy

unread,
Nov 3, 2010, 1:31:19 PM11/3/10
to Google Web Toolkit
After watching gwt 2.1 release doc, I am exciting to try out editor
framework and the request factory.
Currently I had already successfully retieve of a eventProxy from my
mongodb using requestFactory.I am trying to glue the eventProxy to the
editor framework.
I follow the MVP idea which the presenter would tranfer the eventProxy
to the view layer for editing so my view is now implementing
Editor<EventProxy>
Since my eventProxy contain lots of property, which a single class
would be too large, I wish to logically divide the eventProxy into
three part like (name1,name2,name3), (time1,time2,time3) ,
(location1,location2,location3).
I had follow design at hand

class eventPresenter // (injected 1 viewEditor)

class eventView extends Editor<EventProxy> // (injected 1
namesEditor, 1 timesEditor,injected 1 locationsEditor)

class namesEditor extends Composite implements Editor<EventProxy>

class timesEditor extends Composite implements Editor<EventProxy>

class locationsEditor extends Composite implements Editor<EventProxy>


currently the eventPrenter contain the driver code like

interface Driver extends
RequestFactoryEditorDriver<EventProxy, eventView >

should my view implemnts CompositeEditor<EventProxy> or
Editor<EventProxy>
how can I link up the sub-editor nameEditor,timeEditor,locationEditor
with the eventEvent


or i should make three driver code in the presenter layer? like
interface Driver extends RequestFactoryEditorDriver<EventProxy,
nameEditor>
interface Driver extends RequestFactoryEditorDriver<EventProxy,
timeEditor>
interface Driver extends RequestFactoryEditorDriver<EventProxy,
locationEditor>

Thanks for any hint

Tobias

unread,
Nov 4, 2010, 7:02:47 AM11/4/10
to Google Web Toolkit
Hi,

from my understanding so far, the CompositeEditor is only useful if
you want to have a variable number of instances of the same editor,
usually for a list of objects. Look at the example in the docs, there
is a WorkgroupEditor implementing CompositeEditor, which has n
PersonEditors.
For splitting up the editor for a large object, the Editor
documentation actually mentions how to do that in the very last
section: http://code.google.com/webtoolkit/doc/latest/DevGuideUiEditors.html#Very_large_objects
Hope it helps!

Regards,
Tobias

billy

unread,
Nov 11, 2010, 11:42:54 AM11/11/10
to Google Web Toolkit
Just a note to anyone come to this

Finally i add a method in my event object like

Event getSelf(){
return this;
}
void setSelf(){

}

so my view object now have three editor with

@Path("self")
NameEditor

@Path("self")
LocationEditor

@Path("self")
TimeEditor

Please be warn that, I didn't try this with request factory, only on
plain POJO, this approach may blow up your request factory

On 11月4日, 下午7時02分, Tobias <thaberm...@gmail.com> wrote:
> Hi,
>
> from my understanding so far, the CompositeEditor is only useful if
> you want to have a variable number of instances of the sameeditor,
> usually for a list of objects. Look at the example in the docs, there
> is a WorkgroupEditor implementing CompositeEditor, which has n
> PersonEditors.
> For splitting up theeditorfor a large object, theEditor
> documentation actually mentions how to do that in the very last
> section:http://code.google.com/webtoolkit/doc/latest/DevGuideUiEditors.html#V...
> Hope it helps!
>
> Regards,
> Tobias
>
> On Nov 3, 6:31 pm, billy <laibillyki...@gmail.com> wrote:
>
>
>
>
>
>
>
> > After watching gwt 2.1 release doc, I am exciting to try outeditor
> > framework and the request factory.
> > Currently I had already successfully retieve of a eventProxy from my
> > mongodb using requestFactory.I am trying to glue the eventProxy to the
> >editorframework.
> > I follow the MVP idea which the presenter would tranfer the eventProxy
> > to the view layer for editing so my view is now implementing
> >Editor<EventProxy>
> > Since my eventProxy contain lots of property, which a single class
> > would be too large, I wish to logically divide the eventProxy into
> > three part like (name1,name2,name3), (time1,time2,time3) ,
> > (location1,location2,location3).
> > I had follow design at hand
>
> >         class eventPresenter   // (injected 1 viewEditor)
>
> >         class eventView  extendsEditor<EventProxy>  // (injected 1
> > namesEditor, 1 timesEditor,injected 1 locationsEditor)
>
> >         class namesEditor extends Composite implementsEditor<EventProxy>
>
> >         class timesEditor extends Composite implements  Editor<EventProxy>
>
> >         class locationsEditor extends Composite implementsEditor<EventProxy>

David Sanders

unread,
Nov 7, 2011, 10:42:45 AM11/7/11
to google-we...@googlegroups.com
Is there a better way of doing this?  I'm sure there must be some way to split up an editor without creating a workaround referring back to the object being edited?  Perhaps with some kind of annotation?

I just have a flat class that I'm editing with a simple wizard and I've set up a tab panel with a separate ui binder class for each tab.  Now I'm trying to figure out how to make the editor driver descend into individual tabs but I can't seem to find the answer.

David Sanders

unread,
Nov 8, 2011, 3:46:40 AM11/8/11
to google-we...@googlegroups.com
The correct solution is to use @Path("")

See: http://code.google.com/p/google-web-toolkit/source/detail?r=9401


(Thanks to Thomas for pointing out :D)


On 8 November 2011 02:42, David Sanders <shang.xia...@gmail.com> wrote:
Is there a better way of doing this?  I'm sure there must be some way to split up an editor without creating a workaround referring back to the object being edited?  Perhaps with some kind of annotation?

I just have a flat class that I'm editing with a simple wizard and I've set up a tab panel with a separate ui binder class for each tab.  Now I'm trying to figure out how to make the editor driver descend into individual tabs but I can't seem to find the answer.

--
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/-/sqzQCjM3ZNYJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Reply all
Reply to author
Forward
0 new messages