So I’ve got the routing figured out and my mobile app is switching lightning fast between pages.
I’ve tried the following without success directing to a page after success on logout:
Browser componant goto ‘/pagename/’ as set up in routing
Browser componant goto ‘pagename.html’ as per physical filename after changing the page from to content
Static Event with code as per FW7 api for routing to other page: router.navigate({ name: ‘login-screen’ }); My router is setup to handle this:
{
name: ‘login-screen’,
path: ‘/login-screen/’,
url: ‘./pages/login-screen.html’,
options: {
animate: true,
},
},
So at the moment I am balding pulling hair out of my head and not knowing what else to do to make it work…
also tried onsuccess=“router.navigate(’ login-screen.html’)”
Also created a function:
<script>
function signout() {
router.navigate({ name: '/login-screen/' });
};
</script>
and used static Event on-success:
onsuccess=“signout();”
patrick
November 8, 2018, 11:32am
4
did you try onsuccess="app.router.navigate('/login-screen/')"
No - will quickly! Thanks. I am so despirate to get this working
@patrick It works! Appreciate! Only thing now is it ignores
class=“panel-close” with the onsuccess so I will have to look at FW7 api on how to close the panel my sign out is in using the onsuccess as well
Got it!
app.panel.close()
as easy as that!
The world is now my oyster… untill I need your help again
1 Like
psweb
November 8, 2018, 12:06pm
8
Sounds like you are further along than most of us in the mobile development side @pixlapps , what are the chances of us getting a tutorial on some of the things you have managed to get done when you get a moment. Even just some articles or docs to add to the documentation would really be a great help.
2 Likes
That is in the planning @psweb I promised @George an article on my experiences building my first mobile app. The good, the bad and the ugly. Will try for tutorials but I have a dayjob and do the other coding at night and on the weekends. Maybe December will be calmer this side. What I can say is what Thomas Edison said, but I think I am on the right track now:
3 Likes
psweb
November 8, 2018, 12:22pm
10
I will be in Johannesburg in December after a short 5 hour drive from Durban, so if you haven’t found time by then I will just have to come and interview you, mwahaha.
That Thomas Edison quote sounds like the story of my life, to be honest.
1 Like
@psweb I think we could arrange an interview over a beer. LEt me know when you are here. We can have the first official South African Wappler Meetup!
2 Likes
psweb
November 8, 2018, 12:52pm
12
Certainly will @pixlapps , if we are going to be real South African patriots though, it’s going to have to be Klippies and Coke.
1 Like
anofm
January 14, 2020, 11:35am
13
Hi guys, i have the same problem with the redirection after succesfully login but you lost me with
app.panel.close()
where is that to be done?
If I remember correctly you need to run a function on static event and this function tells the panel to close:
app.panel.close();
Bankym
April 1, 2020, 3:03pm
15
Hi Patrick, how do you use flow control with (app.router.navigate…)
Bankym
April 7, 2020, 9:32pm
16
Hi Patrick, how do you achieve this with a flow like this (form1.data.userdetails[0].role == 'admin' ? 'admin.html' : 'user.html' )
Calling native javascript from flows is coming soon
https://community.wappler.io/t/call-external-javascript-in-flow/18775/5
In your case:
<script is="dmx-flow" id="flow1" type="text/dmx-flow">
{
runJS: { function: "navigate", args: "{{ [form1.data.userdetails[0].role == 'admin' ? 'admin.html' : 'user.html'] }}" }
}
</script>
<script>
function navigate(path) {
app.router.navigate(path);
}
</script>
3 Likes