aino-komal / mvp4g

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

@HistoryName doesn't seem to be working #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I followed the MultiModule example to create my multi module application
and I realized that the name I give to my modules with @HistoryName never
appears in the URL as it's said to do in your documentation
(http://code.google.com/p/mvp4g/wiki/PlaceService#History_Management_and_Multi-M
odules_feature).
Instead, the name of the event (the name of the EventBus method) is
displayed in the URL.
Then I realized the same is happening with your MultiModule example.

Original issue reported on code.google.com by david.c....@gmail.com on 30 Mar 2010 at 9:22

GoogleCodeExporter commented 9 years ago
If you look at the Mvp4gModules example, when you display a company, the 
history 
name is stored (you have something like 
#company/goToDisplay?id=2&name=Company%202). 
When you display a product, the history name is also stored (you have something 
like 
#product/goToDisplay?id=0&name=Product%200).

However events fired by the RootModule (like goToCompany & goToProduct), there 
is no 
history name (you have something like #goToCompany and #goToProduct) because 
they're 
fired by the RootModule.

Is it the reason why you don't have the history name in your browser URL?

Original comment by plcoir...@gmail.com on 30 Mar 2010 at 11:43

GoogleCodeExporter commented 9 years ago
Yes that's exactly the case.
Since @HistoryName is attached to the module interface and by the example in 
your
documentation (#module/submodule/event1), I thought that name would be like an 
alias
used when the submodule is loaded.
I see now that it is not the case.
It would be a nice feature though.

Original comment by david.c....@gmail.com on 30 Mar 2010 at 2:48

GoogleCodeExporter commented 9 years ago
What you would like is to have the child module name automatically stored in the
token when a child module is loaded?
I wouldn't be for such feature because developers should have the choice to 
store or
not an event in the history even if it loads a child module. Also, what happens 
if an
event loads several children, which one do you store?

Now maybe you can configure your event bus another way to have the behavior you 
want:
-either associate an history converter with the event of the child module and 
not the
parent. Like that instead of #goToCompany, you would have #company/goToCompany
-or have the name of the event that loads the child module be the same as the 
history
name of the child module. In the example, rename goToCompany to company so that
#company will be stored in the URL.

Hope this help.

Original comment by plcoir...@gmail.com on 31 Mar 2010 at 2:35

GoogleCodeExporter commented 9 years ago
It did help.

Thanks for your quick replies and your tips.

Original comment by david.c....@gmail.com on 31 Mar 2010 at 10:15

GoogleCodeExporter commented 9 years ago

Original comment by plcoir...@gmail.com on 25 Apr 2010 at 10:36

GoogleCodeExporter commented 9 years ago
I am unable to create a child Module from another child Module. How to solve 
it? Has
anybody done this?  I extended the child Module(B) from another child Module(A) 
and
mention the child Module(B) name in the child Module(A) event bus. The history
converter works (convertToToken) works fine but the child Module (B) Impl fails 
to
instantiate due to being abstract class. I guess the inheritance from the child
Module(A) is not being implemented for the child Module(B). ..... Any 
Suggestions!!!!

Original comment by jiunara...@gmail.com on 21 May 2010 at 11:43