Using Editor Framework with GWTP

35 views
Skip to first unread message

Arpit Tripathi

unread,
Dec 9, 2014, 6:24:11 PM12/9/14
to gwt-pl...@googlegroups.com
I'm always confused about GWTP and Editor framework. In general I use the recommendation from this blog: http://floonit.blogspot.com/2012/07/gwtp-and-editors.html

I'm confused what will be used as editor in this case:
Form 1 edits an Entity X and includes Form 2 (PresenterWidget) which edits X.Address. To edit X.Address, Form2 uses some other PresenterWidget (w1) which edits locations using TexBox.
When w1's textbox is empty, I want to show ConstraintViolation error using a label in form2 (since w1 doesn't know anything about editors). I don't know which editor hierarchy to follow so that driver.setConstraintViolations(...) automatically sets errorLabel for field 'Address' in form2. 

Suggestions?

Thanks.

Drew Spencer

unread,
Dec 12, 2014, 6:16:26 AM12/12/14
to gwt-pl...@googlegroups.com
You don't need any PresenterWidgets, just editors. Have Form1Editor as your main one, then have Form2Editor as a sub-editor of that. As long as you have the correct getters and setters it should descend correctly. You can pass events around via the eventBus, or go for a ValueAwareEditor which can monitor its children.

If you post some actual code we might be able to help you more.

Drew
Reply all
Reply to author
Forward
0 new messages