-
16 May 2012 1:21 PM #1
Legacy Bug (MVC)
Legacy Bug (MVC)
Required Information
Version(s) of Ext GWT
«Ext GWT 3.0 Release Candidate»
Browser versions and OS- All browsers and OSes
I would assume both.
Description
Utilizing the Legacy jar to migrate to GXT 3.0:
We utilize the MVC code. Attempt to call Dispatcher.get().dispatch(..., ...), but the event never appears to be handled by the appropriate Controller, and as such, the application fails to proceed as expected.
This ends up in the method Dispatcher.dispatch(AppEvent event, boolean createhistory) ...
Which appears to begin as follows:
(Line 232, for reference.)Code:BeforeAppEvent before = new BeforeAppEvent(event); manager.fireEvent(before); if (before.isCanceled()) { ... handle event ... }
However, before appears NEVER to be canceled. As such, the event is always ignored.
Run mode
Both
Possible fix
It appears the line on 235 should read: if (!before.isCanceled()).
Please let me know what approach I can take to working around this issue.
-
18 May 2012 5:14 PM #2
The final release (gxt-3.0.0-GPL) suffers this defect as well.
While implementing it as suggested (!before.isCanceled()) does work, more fundamentally, it doesn't seem that the
beforeDispatch(final BeforeAppEvent mvce) method of a Dispatcher listener ever gets called.
I can rewrite my app even if both of these things are broken but it does seem as though fundamentally that mvc legacy support is really broken.
Anyway, my workaround was to:
1) replace com.sencha.gxt.legacy.client.mvc.Dispatcher with my own class (a simple copy) com.sencha.gxt.legacy.client.mvc.BugFixDispatcher
2) use the suggested workaround in the dispatch(AppEvent event, boolean createhistory) method: if (!before.isCanceled())
3) also in dispatch(AppEvent event, boolean createhistory), comment out the call to fire the beforeAppEvent since it wasn't working, and call it directly
//manager.fireEvent(before);
FB_Controller.beforeDispatch(before);
//note FB_Controller is a static class in my main class which implements EntryPoint and beforeDispatch is now a static method that I just copied out of the DispatcherListener that was functioning before.Last edited by Shawn.in.Tokyo; 19 May 2012 at 4:08 PM. Reason: did further investigation
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote