[SOLVED] Questions with routes and back links


#1

Next scenario:

When I navigate to the third page the back link does not work anymore.
I have a side menu with submenu where I call a page that contains a listview

<a href="/divida_notificar/"> Notifications </a>

When clicked it goes to my router with async:

path: '/ divida_notificar /',
        async: function (routeTo, routeFrom, resolve, reject) {
            var router = this;
            var app = router.app;
            app.preloader.show ();
            app.request ({'my logic ...'});
                app.preloader.hide ();
                solve ({
                    componentUrl: './pages/divida_notificar.html',
                }, {context: {
                        myObj: myobj
                    }
                });

        },

Until this moment when I click the menu back is working correctly.

Now when you click on the listview item where you have the link:

<a href="/divide_detail/{{cod}}/"> Detail </a>

I pass the router again with async:

path: '/ divida_detail /: cod /',
        async: function (routeTo, routeFrom, resolve, reject) {
            var router = this;
            var app = router.app;
            console.log (routeTo);
            var cod = routeTo.params.cod;
            app.preloader.show ();
            setTimeout (function () {
                app.preloader.hide ();
                solve ({
                    componentUrl: './pages/divida_detail.html'
                }, {context: {
                        cod: cod
                    }
                });
            }, 2000);
        },

At this moment I am inside the detail page, I click on the menu to return again, usually it returns to the page containing the listview.

Now i need return to the homepage by clicking the menu back, but nothing happens, I need to click on my Home to complete the action, where am I going wrong?

I would like to understand more about this feature.
Thank you and strong hug !!


#2

For me, sounds like some missconfig in routes. Do you have live example or something that is possible to check online?


#3

Hi @nolimits4web, sorry but I have nothing online to test, this app I’m developing is only local on the pc. But if you want some more code, I’ll be ready to put it here.
Thanks for the help at the moment, I am still studying f7, and I have many doubts that I can not understand by the documentation.Sorry for the bad english.


#4

Could you solve this? I have a similar problem.
When I enter from Index to Page1 its OK, then I go back from Page1 to Index and finally when I go from Index to Page1 the left panel stop working.


#5

Unfortunately I still can not solve this, I’m dealing with other problems and leaving this for later, if I can resolve the resolution, I ask you to do it, do the same, thank you


#6

For sure @CesarBalzer I’ll get back at you if I can solve it. Thanks.


#7

Hi @CesarBalzer, I could solved my problem with navigation and Left Panel. I think it’s a different problem from yours but still I’ll tell you what I did.
They told me that the Left Panel it’s not supported on Pages and it should be on Index (or your Main App Layout). After moving the code from Page1 to Index, when I navigate back and forth the Left Panel still working fine. The link to my question: V2 Navigation problem


#8

I helped him with this problem, I believe there are no more doubts. Please, @CesarBalzer post the solution is possible, if you have actually solved!!

Thank you!


#9

Sorry for the absence, I’ve been busy with other details, now I’d like to return to discussion. I need to edit the title from resolved to unresolved, this problem I still can not solve.


#10

Cesar, se esgotou as minhas tentativas, infelizmente não conseguir te ajudar, esses dois DEV’s são os melhores que eu conheço, eles com certeza irão te ajudar. Desculpe!

Cesar, if you have exhausted my attempts, unfortunately I can not help you, these two DEV’s are the best I know, they will surely help you. Excuse me!

@nolimits4web ou @pvtallulah


#11

Thank you so much for your help so far my friend


#12

I created an example in the fiddle to try to explain better what I need, after a second navigation, I want to go back to the home page. What would be the best way to do this?

hycur6L7/28/


#13

Hi CesarBalzer,
can you share your routes.js and the panel layout?


#14

Hello @pvtallulah , the above print is already obsolete, I believe that this fiddle code would be the right one to better understand my need, the same thing happens in my app when I need to navigate back to the main page.
Even so, it follows the section of the codes that make the process
https://pastebin.com/HR62CxAt
Thank you


#15

You need to have home route, e.g. /, and then just use

<a href="/" data-force="true" class="back">Back to home</a>

https://jsfiddle.net/nolimits4web/7vhnea2r/


#16

Hello Vladimir, now everything worked perfectly, that’s what I was missing out on, correct me if I’m wrong, but by my understanding the “/” route needs a page for it, index.html is not considered the “root” of app, so it said that it did not exist and it did not work either to go back or to redirect to the index, because the root would be this page that we are on the routes as in the example of the fiddle that you did creating home.

I want to thank you for helping you @nolimits4web , @JhowJhoe and @pvtallulah and to say that Framework7 exceeded my expectations.

Congratulations Vladimir for the excellent work.

You can close the post and flag as resolved please.


#17

Excelente, finalizando o tópico. :clap: