aino-komal / mvp4g

Automatically exported from code.google.com/p/mvp4g
0 stars 0 forks source link

Use of historyConvertor overrides navigationEvent = false in @Event annotation #123

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Setup a presenter to be informed of any navigation changes, as follows

    eventBus.setNavigationConfirmation(this);

2. Annotate an event/method in the main application event bus, as follows

@Event( handlers = RootPresenter.class, navigationEvent = false, 
historyConverter = AppHistoryConverter.class)
void downloadResource(String resourceName);

3. Call the event from somewhere (or in my app I use a hyperlink), like
    eventBus.downLoadResource("info.pdf");

4. The presenter who requested navigation control is called even though the 
event is set as a non navigation event.

What is the expected output? What do you see instead?
No navigation confirmation to the presenter in step 1.

What version of the product are you using? On what operating system?
Mvp4g 1.4.0
GWT 2.4.0
Windows 7

Please provide any additional information below.
The use case is as follows. 
A multi-page wizard is required where there are some hyperlinks to pdf files so 
the user can browse these which may assist in the data entry process. These 
files reside on the server and will be opened in other browser tabs. So in this 
case the hyperlinks have nothing to do with navigation concerns as we ensure 
the request to the server is made in another browser window.

Original issue reported on code.google.com by paul.wi...@engsol.com.au on 25 Feb 2013 at 7:40

GoogleCodeExporter commented 9 years ago
The navigation confirmation is called because you're using hyperlink which 
changes the URL and fire a GWT History value change event:
https://code.google.com/p/mvp4g/source/browse/trunk/sources/src/main/java/com/mv
p4g/client/history/PlaceService.java#92

So this is not a bug but the expected behavior.

I think in this case, you shouldn't fire your event via hyperlink but you 
should use the event bus directly.

Original comment by plcoir...@google.com on 28 Feb 2013 at 11:25

GoogleCodeExporter commented 9 years ago
The navigation confirmation is called because you're using hyperlink which 
changes the URL and fire a GWT History value change event:
https://code.google.com/p/mvp4g/source/browse/trunk/sources/src/main/java/com/mv
p4g/client/history/PlaceService.java#92

So this is not a bug but the expected behavior.

I think in this case, you shouldn't fire your event via hyperlink but you 
should use the event bus directly.

Original comment by plcoir...@google.com on 28 Feb 2013 at 11:25

GoogleCodeExporter commented 9 years ago
On further thought, I agree. I got around the issue by creating the hyperlink 
that points directly to a servlet resource.

Original comment by paul.wi...@engsol.com.au on 28 Feb 2013 at 11:59

GoogleCodeExporter commented 9 years ago

Original comment by plcoir...@gmail.com on 6 Sep 2013 at 4:32