Skip to content

Investigate Routing for generated apps #37

Closed
js1972 opened this Issue Feb 1, 2014 · 10 comments

2 participants

@js1972
Collaborator
js1972 commented Feb 1, 2014

No description provided.

@js1972 js1972 added this to the 0.2.2 milestone Feb 6, 2014
@js1972
Collaborator
js1972 commented Feb 18, 2014

Testing with a generated Tiles app. There is a problem that routes cannot be bookmarked. Even the sap.m.SplitApp example provided with the SDK does not bookmark.
You should be able to navigate within your app and then bookmark where you are. Upon loading the bookmark you are taken back to where you left off. This does work with routing frameworks such as Director.js that I have tested. However not for jQuery.sap.history.

It seems that when you load the bookmark then history route handler is executed before the view which the page relies on is instantiated - and therefore in the route handler you cannot call to() or back() rendering the logic useless.?!? In fact with Chrome tools you can see the the app does not even GET the view file.

Anyone got example of this working?

@js1972 js1972 self-assigned this Feb 18, 2014
@js1972
Collaborator
js1972 commented Feb 18, 2014

See this test app: https://github.com/js1972/test

@js1972
Collaborator
js1972 commented Feb 19, 2014

Added a "route" branch to the above test repo. The test app now uses the new component-based routing mechanism.
Still seems to be an issue in that bookmarked routes do not work. The SDK-provided splitapp example also does not work with bookmarked routes.

Its as if the data binding is not set.

@js1972
Collaborator
js1972 commented Feb 22, 2014

Using the new component-based routing mechanism, the router takes over all navigation and view instantiation responsibilities. Given that this is a totally different application architecture it probably should be give an another option to the user: "add routing".

@saschakiefer
Owner

Is that sth. you just add as a feature or would that be new application template?

@js1972
Collaborator
@js1972
Collaborator
js1972 commented Feb 24, 2014

See this sample app and readme for details. We just need to think about how to architect this into the generator.

https://github.com/js1972/test_ui5_routing

We could:
a) Have a completely different set of template apps that include routing out of the box;
b) Have a routing sub-generator that is clever enough to do the refactoring of your app to include routing based on a few questions - this would be fantastic but difficult I expect as you need to wire any views into the routes;
c) Default all generated apps to use routing as standard.

(I'm probably thinking to go with option (a) at the moment.)

Anything else @saschakiefer or anyone else can think of?

@js1972
Collaborator
js1972 commented Feb 26, 2014

The test app https://github.com/js1972/test_ui5_routing has been updated and now works perfectly as expected. After much investigation there are issues with both the real Northwind oData service as well as the mock one provided by the UI5 team.
The real one has DNS issues and does not work from Windows computer here (yet works just fine on my Mac). The fake one does not handle all nuances of oData and crashes the model binding in certain situations (such as when loading from a route).

Answer - write my own bloody test data! Problem solved - routing and model binding work perfectly again!

@saschakiefer if you get a chance can you have a quick look at this app. I want to add the detail screen onto our template Tiles app just so that it displays something and not an empty page as it does currently. You'll also see how the component-based routing works so that we can decide whether not to support it....

@js1972
Collaborator
js1972 commented Jan 23, 2015

This has already been done in the new component-based app templates. Just needs to be merged into master.

@js1972
Collaborator
js1972 commented Jan 29, 2015

Closing. See the TDG app template for an example of routing or scaffold out your project in WebIDE where you will get the latest component based routing mechanism.

@js1972 js1972 closed this Jan 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.