Re: Editor framework problem

36 views
Skip to first unread message

Thomas Broyer

unread,
Dec 10, 2012, 3:30:43 AM12/10/12
to google-we...@googlegroups.com
Keep in mind that everything in GWT (Editor, UiBinder, PlaceHistoryMapper, etc.) is done by static-analysis at compile-time. If the MyPersonEditor interface doesn't expose the sub-editors (getter methods, possibly annotated with @Path) then the generator won't "see" them. At runtime you could use MyPersonEditorImpl or any other class that implements MyPersonEditor, but the code is generated once for MyPersonEditor, so only things that are in that interface are taken into account.

On Monday, December 10, 2012 2:27:29 AM UTC+1, Vesko Georgiev wrote:
Hi everyone,

I faced the following problem, not sure whether it's a bug or a feature. It occurs if the Driver class has the editor generic type as an interface, but not the actual implementation. Note that MyPersonDriver references MyPersonEditor, not MyPersonEditorImpl. In this case the line: driver.edit(somePerson, requestContext);
does not populate the form. If I use MyPersonEditorImpl it works, but when the driver does not reference the actual class it doesn't.

interface MyPersonEditor extends Editor<PersonProxy>, MyOtherInterface {

...

}


interface MyPersonDriver extends RequestFactoryEditorDriver<PersonProxy, MyPersonEditor> {

...

}


class MyPersonEditorImpl extends Composite implements MyPersonEditor {

@UiField

ValueBoxEditorDecorator<String> name;

...

}


MyPersonDriver driver = GWT.create(MyPersonDriver.class);

driver.edit(somePerson, requestContext);



Cheers,
Vesko
Reply all
Reply to author
Forward
0 new messages