# Gotorelative navigation issue

**URL:** <https://forums.fusetools.com/t/gotorelative-navigation-issue/5544>\
**Category:** How-to Discussions\
**Created:** [April 22, 2017, 3:00pm UTC](https://forums.fusetools.com/t/gotorelative-navigation-issue/5544 "2017-04-22T15:00:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![prince](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@prince](https://forums.fusetools.com/u/prince)\
**Post date:** [April 22, 2017, 3:00pm UTC](https://forums.fusetools.com/t/gotorelative-navigation-issue/5544/1 "2017-04-22T15:00:01Z")

</div>

Hi guys,  
i have to build two calendar on the same view (per month and per week) using page control.

> **[Screenshot](https://prnt.sc/ezid60)**
>
> Captured with Lightshot

  
but the problem is when i try to navigate to the next month on the calendar per month view , it sometimes push the page control navigation to the week view and try to reach the week calendar view navigation (there are separated) and give me an error.  
[https://youtu.be/258wsJbFPqY](https://youtu.be/258wsJbFPqY), when i quotes the week view the month calendar work well [https://youtu.be/JxPICPg\_Uqg](https://youtu.be/JxPICPg_Uqg)  
this is my code for the page who display both week and month view using page control.

```auto
  <PageControl ux:Name="MontsDate">
    <Page ux:Name="MO">
      <CalendarMonth ux:Name="monthDate" router="router"/>
      <ActivatingAnimation>
        <Change MoisRect.Opacity="1" Easing="Linear"/>
      </ActivatingAnimation>
    </Page>
    <Page ux:Name="Se">
      <CalendarWeek ux:Name="weekDate" router="router"/>
      <ActivatingAnimation>
        <Change SemaineRect.Opacity="1" Easing="Linear"/>
      </ActivatingAnimation>
    </Page>
  </PageControl>

```

this is the the month view

```auto
<DockPanel ux:Class="CalendarMonth">
  <Router ux:Dependency="router" />
  <JavaScript>
  var d = new Date()
  router.gotoRelative(calNav, "month", { month: d.getMonth(), year: d.getFullYear() } )
  </JavaScript>
  <Navigator ux:Name="calNav">
    <Mois ux:Template="month" router="router" SwipeBack="None"/>
  </Navigator>
</DockPanel>

```

this is the week view.

```auto
<DockPanel ux:Class="CalendarWeek">
  <Router ux:Dependency="router" />
  <JavaScript>
  var d = new Date()
  router.gotoRelative(WeekDispo, "semaine", {week: d})
  </JavaScript>
  <Navigator ux:Name="WeekDispo">
    <Semaine ux:Template="semaine" router="router" SwipeBack="None"/>
  </Navigator>
</DockPanel>

```

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [April 22, 2017, 4:59pm UTC](https://forums.fusetools.com/t/gotorelative-navigation-issue/5544/2 "2017-04-22T16:59:07Z")

</div>

Hi prince,

I tried to give your code a go, but it’s clearly missing some significant parts and I can’t recreate the navigation flow you’re describing.

Would you mind stripping down your larger application and posting a complete reproduction we could take a look at?

The only thing that strikes me immediately is that you have imperative calls to `router.gotoRelative`. I think that these should instead be called from an `<Activated>` trigger, so you clearly know they only execute when the calendar/week view page is activated.

---

<div class="post-metadata">

**Author:** ![prince](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@prince](https://forums.fusetools.com/u/prince)\
**Post date:** [April 22, 2017, 5:42pm UTC](https://forums.fusetools.com/t/gotorelative-navigation-issue/5544/3 "2017-04-22T17:42:50Z")

</div>

Hi Uldis thank you a lot for taking the time to help me.

Yes some part of my code is missing.

_EDIT: because of large amounts of code, the project has been shared directly for debugging over other channels._

router.bookmark are activated only when i’m on that page , so router normally need to work only on that view.

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [April 23, 2017, 8:15am UTC](https://forums.fusetools.com/t/gotorelative-navigation-issue/5544/4 "2017-04-23T08:15:20Z")

</div>

So the problem appears to be rooted in the fact that the UX implementation of `RouterModify` differs from JS implementation of `router.modify()` in that, that the bookmarks used in the UX case can not be “relative” [for now].

Suggestion is to try and implement a different relative navigation using `router.modify()` instead.
