RequestFactoryEditorDriver returns empty array for getPaths

18 views
Skip to first unread message

Maiku

unread,
Sep 29, 2011, 7:33:24 PM9/29/11
to Google Web Toolkit
I was banging my head against the wall trying to figure out why my
ListEditor is not displaying any objects from a List<LanguageProxy> in
my ConfigProxy. I then realized I wasn't using the ".with" command.
So I set it up with the standard idiom:

.with(view.editorDriver().getPaths()).fire(....);

But then found out that the getPaths() method is returning an empty
array. Is this a known issue (unlikely) or have I set something up
wrong (more likely). Here is a rough outline of my setup for this
editor:

* ConfigPresenter implements Presenter
* ConfigView implements Editor<ConfigProxy> and contains getter
methods annotated with @Path
* ConfigViewImpl implements ConfigView and contains the interface that
extends RequestFactoryEditorDriver<ConfigProxy, ConfigView>

I thought maybe it wasn't working because I use using the simple
version of Driver.initialize(editor) instead of
Driver.initialize(RequestFactory, editor) but after changing it
(granted I had to do it in a rather contrived way as trying to
initialize the Driver from the Presenter like I was previously doing
wouldn't work in this case) the getPaths() still returned an empty
array.

Is there a step that I am missing?

-sowdri-

unread,
Sep 30, 2011, 12:49:50 AM9/30/11
to google-we...@googlegroups.com
>> .with(view.editorDriver().getPaths()).fire(....); 

Assuming: 

// on the server
class Config ... {
    List<Language> languageList;
}

This could be simply be
.with("languageList").fire(....);  

>> I thought maybe it wasn't working because I use using the simple version of Driver.initialize(editor) instead of Driver.initialize(RequestFactory, editor)
Simple version will work!

Thomas Broyer

unread,
Sep 30, 2011, 4:18:49 AM9/30/11
to google-we...@googlegroups.com
Are you sure the editor driver "sees" the ListEditor?

Set a breakpoint in PathCollector to see which editor it visits (this is done when you initialize() the driver), and try to understand why it doesn't "collect" the path for your list (note that the PathCollector only collects paths for non-value-types, unless the editor for a value-type uses a @Path referencing a sub-object –i.e., with a "." in it.)
Reply all
Reply to author
Forward
0 new messages