# Perspective URL props to docked window

**URL:** <https://forum.inductiveautomation.com/t/perspective-url-props-to-docked-window/38550>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [September 10, 2020, 1:21pm UTC](https://forum.inductiveautomation.com/t/perspective-url-props-to-docked-window/38550 "2020-09-10T13:21:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcarritt1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mcarritt1/32/4262_2.png) [@mcarritt1](https://forum.inductiveautomation.com/u/mcarritt1)\
**Post date:** [September 10, 2020, 1:21pm UTC](https://forum.inductiveautomation.com/t/perspective-url-props-to-docked-window/38550/1 "2020-09-10T13:21:36Z")

</div>

Been having some trouble with something that seems like it really shouldn’t be difficult.

We have a perspective project that utilizes a parameter specified in the URL. For the main views on pages this works as expected. But there doesn’t appear to be an easy way to get that parameter for docked views however. I can try to use the page.props.pagePath, but if the user goes and changes the URL manually, or opens a bookmark, it seems to me there is a bug where it gives the previous page path.

So here’s what I’m doing right now:

1. Navigate to a page; the main view and docked view start.
2. On the startup script of my docked window, I send a message to the main view saying “I’m open now and running”.
3. The Main view on that page receives the message, and then sends a 2nd message saying “this is the parameter from the url”.
4. then the docked window can now run a script to load things in based on the parameter, now that I know that both views are running/responding. (In this script it tells the main view a bunch of information through another message).

This all assumes that docked views will always start after main views. If it’s random, or just that my main view happens to be finishing first, then potentially this could all break down if the docked view happens to start first (because the main view isn’t fully running yet and won’t receive the message).

We **cannot** use a session property, because a user might have 3 or 4 pages open at the same time, with different parameters in the url to look at totally different things.

Is there a better way? It’s very weird to me that docked views can’t get the URL parameter in the same manner as main views.

---

<div class="post-metadata">

**Author:** ![mcarritt1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mcarritt1/32/4262_2.png) [@mcarritt1](https://forum.inductiveautomation.com/u/mcarritt1)\
**Post date:** [September 10, 2020, 1:23pm UTC](https://forum.inductiveautomation.com/t/perspective-url-props-to-docked-window/38550/2 "2020-09-10T13:23:53Z")

</div>

Additionally, if anyone from Inductive reads this, if passing the URL parameter to a docked view is a difficult change, being able to set custom page parameters would also be a great addition.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [September 10, 2020, 6:19pm UTC](https://forum.inductiveautomation.com/t/perspective-url-props-to-docked-window/38550/3 "2020-09-10T18:19:47Z")

</div>

Fundamentally, you’re right - this shouldn’t be so difficult. Perhaps we should simply set the page URL parameters on all views that have the proper input defined. So for example, if you had the page mounted at `/mypage/:paramName` and _both_ your primary view and a docked view defined an input named `paramName`, we could simply set both.

In the meantime, however, there _is_ an easier way than passing messages, which as you surmised, is not really that safe (you can’t rely on one view loading before the other, their loading speed is relative to their complexity and is largely at the whim of the browser)

The “page” props are themselves a writable space. There’s no issue in you using that namespace for your own purposes. For example, you can do this in your main view’s startup event:  
`self.page.props.paramSharing = {'paramName': self.params.paramName}`

And then you can simply bind something in the docked view to `page.props.paramSharing.paramName`

(there’s nothing special about the name “paramSharing” you can put them in whatever organization you’d prefer)

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [September 10, 2020, 9:42pm UTC](https://forum.inductiveautomation.com/t/perspective-url-props-to-docked-window/38550/4 "2020-09-10T21:42:37Z")

</div>

> [@Carl.Gould](#):
>
> The “page” props are themselves a writable space. There’s no issue in you using that namespace for your own purposes.

I did not know that, could definitely be useful.

---

<div class="post-metadata">

**Author:** ![mcarritt1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mcarritt1/32/4262_2.png) [@mcarritt1](https://forum.inductiveautomation.com/u/mcarritt1)\
**Post date:** [September 10, 2020, 10:31pm UTC](https://forum.inductiveautomation.com/t/perspective-url-props-to-docked-window/38550/5 "2020-09-10T22:31:35Z")

</div>

Oh ok sweet! Befoere this post I tried assigning a variable and value to page props and got an error but I’ll give it another shot with your example. Thanks!
