# Router and PageControl issues 

**URL:** <https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355>\
**Category:** How-to Discussions\
**Created:** [September 16, 2016, 2:50pm UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355 "2016-09-16T14:50:19Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergey](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/sergey/32/182_2.png) [@Sergey](https://forums.fusetools.com/u/Sergey)\
**Post date:** [September 16, 2016, 2:50pm UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355/1 "2016-09-16T14:50:19Z")

</div>

Hi, Guys!  
We need yours assistant.

There is an project which implemented via PageControl and screens with different routers.

Here is simple structure and [small scheme (click here)](https://s.mail.ru/DjbA/17Rz4eG92)

###### MainView.ux

```auto
<App>
 // tab bar here
 <PageControl Active="{tabbarActiveTab}">
  <ux:Include File="RouterA.ux" />
  <ux:Include File="RouterB.ux" />
 </PageControl>
</App>

```

### 

###### RouterA.ux

```auto
<Page ux:Name="RouterA" Transition="None">
 <Router Name="router_a" />

 <Navigator DefaultTemplate="screenA1">
  <screenA1 ux:Template="screenA1" router="router_a" />
  <screenA2 ux:Template="screenDetailsA2" router="router_a" />
  <screenA3 ux:Template="screenDetailsA3" router="router_a" />
 </Navigator>
</Page>

```

###### RouterB.ux

```auto
<Page ux:Name="RouterB” Transition="None">
 <Router Name="router_b" />

 <Navigator DefaultTemplate="screenB1">
  <screenB1 ux:Template="screenB1" router="router_b" />
  <screenB2 ux:Template="screenDetailsB2" router="router_b" />
 </Navigator>
</Page>

```

###### screenA1.ux

```auto
<Page ux:Class="screenA1">
 <Router ux:Dependency="router" />

 <JavaScript>
  // fetch json
  module.exports = {
   details: function(param) {
    router.push("screenDetailsA2", param.data)
   },
  };
 </JavaScript>
</Page>

```

###### screenDetailsA2.ux

```auto
<Page ux:Class="screenDetailsA2">
 <Router ux:Dependency="router" />

 <JavaScript>
  module.exports = {
   back: function() {
    router.goBack()
   }
  }
 </JavaScript>
</Page>

```

Screens with router\_b were made the same way as screenDetailsA2.ux

> 1. If we navigate to RouterB, and click details we’ll get screenDetailsB2.
> 2. Than click RouterA.ux via bottom tabbar, and than click details to reach screenDetailsA2
> 3. And than back to RouterB.ux via bottom tabbar to prees back Clicked={"back»}
> 4. At this point we getting an error (Unable to navigate to route: screenA1)

Questions:

- Is able to switch off swiping between screens in PageControl (not transition animation)
- Are we able to implement «SwipeToBack» inside internal pages? (screenDetailsA2, etc) Is there some features?
- We have some errors at start, but all works fine:

```auto
InternalError: Can not navigate to 'screenA1', not found!
InternalError: Unable to navigate to route: screenA1
InternalError: Can not navigate to 'screenB1', not found!
InternalError: Unable to navigate to route: screenB

```

You are doing well, keep going!

---

<div class="post-metadata">

**Author:** ![Remi\_Pedersen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/remi_pedersen/32/432_2.png) [@Remi\_Pedersen](https://forums.fusetools.com/u/Remi_Pedersen)\
**Post date:** [September 16, 2016, 3:02pm UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355/2 "2016-09-16T15:02:46Z")

</div>

> Is able to switch off swiping between screens in PageControl (not transition animation)

> **[Fuse](https://www.fuse.no/)**
>
> We create mobile winners Fuse works with ambitious companies to create world class digital products

---

<div class="post-metadata">

**Author:** ![Sergey](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/sergey/32/182_2.png) [@Sergey](https://forums.fusetools.com/u/Sergey)\
**Post date:** [September 16, 2016, 3:13pm UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355/3 "2016-09-16T15:13:44Z")

</div>

> **Remi Pedersen wrote:**
> 
> > Is able to switch off swiping between screens in PageControl (not transition animation)
> 
> [Fuse](https://www.fusetools.com/community/forums/howto_discussions/how_to_disable_child_page_controls_swipe)

Thanks Remi it works!

Do you know something about issue when project got 3 or more tabs and switching between first one and last going through all rest pages. What I exactly mean when we have got 3 tabs and I stay at first and click 3rd, second screen always blinking between switching.

---

<div class="post-metadata">

**Author:** ![keiby](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@keiby](https://forums.fusetools.com/u/keiby)\
**Post date:** [September 16, 2016, 8:08pm UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355/4 "2016-09-16T20:08:21Z")

</div>

> **Sergey wrote:**
> 
> > 1. If we navigate to RouterB, and click details we’ll get screenDetailsB2.
> > 2. Than click RouterA.ux via bottom tabbar, and than click details to reach screenDetailsA2
> > 3. And than back to RouterB.ux via bottom tabbar to prees back Clicked={"back»}
> > 4. At this point we getting an error (Unable to navigate to route: screenA1)

I have the same troubles with routers. Any suggestions?

---

<div class="post-metadata">

**Author:** ![Sergey](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/sergey/32/182_2.png) [@Sergey](https://forums.fusetools.com/u/Sergey)\
**Post date:** [September 20, 2016, 2:04pm UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355/5 "2016-09-20T14:04:02Z")

</div>

Guys, we really need to resolve issues above. Is anybody here who met same problems?

---

<div class="post-metadata">

**Author:** ![Remi\_Pedersen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/remi_pedersen/32/432_2.png) [@Remi\_Pedersen](https://forums.fusetools.com/u/Remi_Pedersen)\
**Post date:** [September 20, 2016, 3:52pm UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355/6 "2016-09-20T15:52:07Z")

</div>

It’s a bit difficult to debug this based only on a few pieces of your example. If you can upload a full repro case to [https://www.dropbox.com/request/ZgndLtJQm5eGzG9cicGK](https://www.dropbox.com/request/ZgndLtJQm5eGzG9cicGK) (only visible to Fuse employees), we’ll take a closer look.

---

<div class="post-metadata">

**Author:** ![Remi\_Pedersen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/remi_pedersen/32/432_2.png) [@Remi\_Pedersen](https://forums.fusetools.com/u/Remi_Pedersen)\
**Post date:** [September 20, 2016, 3:55pm UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355/7 "2016-09-20T15:55:27Z")

</div>

> Do you know something about issue when project got 3 or more tabs and switching between first one and last going through all rest pages. What I exactly mean when we have got 3 tabs and I stay at first and click 3rd, second screen always blinking between switching.

This happens because the PageControl is based on linear navigation where each page has a fixed position relative to the other pages. If you instead use direct navigation or hierarchical navigation (for instance in the way you’re already using Router / Navigator) then you can avoid this behavior.

---

<div class="post-metadata">

**Author:** ![Sergey](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/sergey/32/182_2.png) [@Sergey](https://forums.fusetools.com/u/Sergey)\
**Post date:** [September 27, 2016, 4:05pm UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355/8 "2016-09-27T16:05:02Z")

</div>

> **Remi Pedersen wrote:**
> 
> It’s a bit difficult to debug this based only on a few pieces of your example. If you can upload a full repro case to [Dropbox](https://www.dropbox.com/request/ZgndLtJQm5eGzG9cicGK) (only visible to Fuse employees), we’ll take a closer look.

Hi there! fuse\_movies.zip already uploaded! Check this out please!  
Please help us with routers.

Contact email: [azmotic@gmail.com](mailto:azmotic@gmail.com)

Thanks!

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [September 27, 2016, 4:56pm UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355/9 "2016-09-27T16:56:22Z")

</div>

Sergey: I downloaded and started preview in your app, but can’t get it to crash. Do you have steps to reproduce?

Next time, when you have multiple issues, please split up into multiple threads, where you explain each issue/question in detail with test case, steps to reproduce and code for each issue. It is a bit confusing to understand what you need help with here, and what is most critical.

Very cool looking app btw 🙂

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [September 27, 2016, 5:02pm UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355/10 "2016-09-27T17:02:46Z")

</div>

The app seems to manifest a few weird performance issues too - creating an internal ticket to have this investigated. Thanks for the test case.

---

<div class="post-metadata">

**Author:** ![Sergey](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/sergey/32/182_2.png) [@Sergey](https://forums.fusetools.com/u/Sergey)\
**Post date:** [September 27, 2016, 5:21pm UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355/11 "2016-09-27T17:21:55Z")

</div>

> **Anders Lassen wrote:**
> 
> Sergey: I downloaded and started preview in your app, but can’t get it to crash. Do you have steps to reproduce?
> 
> Next time, when you have multiple issues, please split up into multiple threads, where you explain each issue/question in detail with test case, steps to reproduce and code for each issue. It is a bit confusing to understand what you need help with here, and what is most critical.
> 
> Very cool looking app btw 🙂

There are few cases illustrated

[https://yadi.sk/d/stnBDoMuvokgL](https://yadi.sk/d/stnBDoMuvokgL)

Thank you!

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [September 29, 2016, 9:08am UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355/12 "2016-09-29T09:08:36Z")

</div>

The peformance problems have been investigated: it turns out only to be a problem in desktop preview and builds (on mobile devices it runs fine), and those problems are gone in the next version of our text engine, soon to be merged. It was due to our old desktop text renderer dealing poorly with non-ascii characters.

Will investigate the crashes now.

---

<div class="post-metadata">

**Author:** ![Sergey](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/sergey/32/182_2.png) [@Sergey](https://forums.fusetools.com/u/Sergey)\
**Post date:** [September 29, 2016, 9:13am UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355/13 "2016-09-29T09:13:02Z")

</div>

> **Anders Lassen wrote:**
> 
> The peformance problems have been investigated: it turns out only to be a problem in desktop preview and builds (on mobile devices it runs fine), and those problems are gone in the next version of our text engine, soon to be merged.
> 
> Will investigate the crashes now.

Thanks guys!

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [September 29, 2016, 9:26am UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355/14 "2016-09-29T09:26:08Z")

</div>

I can’t reproduce _crashes_ here, but I do get this error message in the output:

```
InternalError: Can not navigate to 'ScreenDetailsNews', not found! in Fuse.Controls.Navigator<C:\Users\Anders\Documents\GitHub\Uno\lib\fuselibs\Source\Fuse.Controls.Navigation\Navigator.uno:195>
Error: Unable to navigate to route: ScreenDetailsNews?{"author":"??????.???????, Life.ru","description":"½???????-2016╗áù ?????????? ??????? ???????? ?á????? ??????, ??????? ???????? ?????? ?????? ?á??????????? ?????? ½?????? ?????╗ (????? ??á???????? ????? ½????????╗).","image":"","timestamp":"??????? ? 11:00","title":"½???????-2016╗ ?????? ???? ????? ???á???????? ??á???? ??????","url":"https://news.yandex.ru/yandsearch?cl4url=life.ru%2F909740"} in Fuse.Navigation.Router<C:\Users\Anders\Documents\GitHub\Uno\lib\fuselibs\Source\Fuse.Navigation\Router.uno:250>

```

App continues to run fine though?

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [September 29, 2016, 9:32am UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355/15 "2016-09-29T09:32:33Z")

</div>

The problem here is that you have multiple navigators in the same scope, so it doesn’t know what navigator is supposed to navigate to `ScreenDetailsNews`.

Your structure is basically:

```
<App>
    <Router />
    <DirectNavigation />
    <Page>
    		<Navigator>...
    </Page>
    <Page>
    		<Navigator>...
    </Page>
    <Page>
    		<Navigator>...
    </Page>

```

This structure is not allowed, as the Router will only see the first navigator.

For this to work, you have to use one router per navigator, or use a navigator instead of your `DirectNavigation`.

---

<div class="post-metadata">

**Author:** ![Anders\_Lassen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/anders_lassen/32/522_2.png) [@Anders\_Lassen](https://forums.fusetools.com/u/Anders_Lassen)\
**Post date:** [September 29, 2016, 10:02am UTC](https://forums.fusetools.com/t/router-and-pagecontrol-issues/3355/16 "2016-09-29T10:02:19Z")

</div>

The above accounts for both of the reported problems, so considering this case closed until further nothice.

I reccommend removing `DirectNavigation` and going back to multi-level navigation with nested `<Navigator>`, looking at your commented-out sections this looks like your original design. If this change was done to avoid transition-problems, please re-post that as a separate issue and we’ll help out with that.
