Hi Community,
I've already posted in the following the gwt group of google but didn't get any response. So maybe you can help me...
I’m not new to GWT but didn’t work with GWT 2.1.1 yet – so this is the first time.
I've spent much time in analyzing the application spring roo generated for me. There're some entities, views, activities and a very (I think) complex structure which is not made for customizing. I've read through all the documentation of google and the samples of Thomas Broyer but didn't come any further with this generated app. The next step was to paint down the structure - urgh - didn't help a lot.
Then I tried to debug and – wouh – it’s getting lighter. That’s the way after application is started and you click on the create button for a proxy (right?) :
a) Button clicked in childclass of AbstractProxyListActivity which contains the delegate logic (View -> Delegate == Activity).
b) Create a new ProxyPlace(MyProxy.class) which implies the Operation.CREATE
c) Call the PlaceController to go to the new Place
d) Ask the ActivityManager which is the next activity
- There are two mappers defined in ScaffoldDesktopApp
e) ApplicationDetailsActivities_Roo_Gwt is called b/c it’s the mapper of the ActivityManager
f) The ApplicationEntityTypesProcessor chooses the correct Proxy to be handled
g) Create the mapper for the proxy with new MyProxyActivitiesMapper and get the final activity
h) Map the operation – we have an Operation.CREATE so…
i) Call the makeCreateActivity() within MyProxyActivitiesMapper which
j) Returns a wrapper for the new activity with its view MyProxyEditActivityWrapper
k) This activity wrapper is set as result of ApplicationEntityTypesProcessor
l) Which will be returned to the ActivityManager
Here’s what I’m confused about or don’t understand:
1. What’s the full functionality of ApplicationDetailsActivities_Roo_Gwt and ApplicationEntityTypesProcessor – seems that they choose the right proxy to handle and the correct operation to be used. But isn’t there an easier, non-confusing way?
2. Why every view extends MyProxy_Roo_Gwt?
The documentation of roo says it’s for better seeing, that this part is roo managed gwt code. But.. what’s there roo managed and why – this makes it not easier to customize the app.
3. How to update a view? Let’s say a simple button which clears all fields in an editor. Or couldn’t this be done by Gwt 2.1.1 without calling a new activity (and with the help of the activity – do we really have to pass the “what to do in the view” as parameters in the place?)
4. Let’s say I’d like to fire an event if a button is clicked and the menu has to handle this event. Which class has to implement the handler and how to update the view (maybe add a menu item) – perhaps it’s like point 3.
Why I said this app is not made for customizing? This is easy: I simply like to add a button to an edit view which clears all fields of the editor. There’s no way to do it for one editor b/c all views use the same interface with the same delegate. So I have to create a new interface and a new delegate.
Because of the new interface (which could not extend the old one, because it’s not possible with the generics later in the activities) I have to create a new edit activity which contains the logic for the clear button and implements my interface.Code:public interface ClearProxyEditView<P extends EntityProxy, V extends ClearProxyEditView<P, V>> extends IsWidget, HasEditorErrors<P> { … interface ClearDelegate { void cancelClicked(); void saveClicked(); void clearClicked(); } … }
Hmm there’s some more – I cannot use the original FindAndEditProxy and CreateAndEditProxy b/c they need a ProxyEditView. Okay.. create new proxies and call them ClearFindAndEditProxy and ClearCreateAndEditProxy for now and just change the constructor. At last I have to change the interfaces for the view in MyProxyEditActivityWrapper and MyProxyEditActivityWrapper_Roo_Gwt to use my ClearProxyEditView as generic type or extending it.Code:public abstract class ClearProxyEditActivity<P extends EntityProxy> implements Activity, ClearProxyEditView.ClearDelegate { … public void clearClicked() { //TODO: clear all fields // but how to update the view? } … }
The questions are
- How to update the view and clear the fields?
- Is there an easier way to do this?
And I don’t have any idea how to add views not based on a proxy. Is there anybody who already tried it?
Regards
Erik


Reply With Quote
