# Perspective Horizontal Menu - Passing Parameters

**URL:** <https://forum.inductiveautomation.com/t/perspective-horizontal-menu-passing-parameters/65392>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 19, 2022, 11:59am UTC](https://forum.inductiveautomation.com/t/perspective-horizontal-menu-passing-parameters/65392 "2022-10-19T11:59:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![djones](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@djones](https://forum.inductiveautomation.com/u/djones)\
**Post date:** [October 19, 2022, 11:59am UTC](https://forum.inductiveautomation.com/t/perspective-horizontal-menu-passing-parameters/65392/1 "2022-10-19T11:59:07Z")

</div>

I am trying to pass a parameter from a horizontal menu component to launch a view. I can launch the view no problem, but cannot for the life of me figure out how to pass parameters from the component.

---

<div class="post-metadata">

**Author:** ![Joe\_Seph](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joe_seph/32/40277_2.png) [@Joe\_Seph](https://forum.inductiveautomation.com/u/Joe_Seph)\
**Post date:** [October 31, 2022, 7:29pm UTC](https://forum.inductiveautomation.com/t/perspective-horizontal-menu-passing-parameters/65392/2 "2022-10-31T19:29:05Z")

</div>

Hi, are you trying to pass a custom property? What exactly does your setup look like on your component? What is the end goal with this parameter?

---

<div class="post-metadata">

**Author:** ![djones](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@djones](https://forum.inductiveautomation.com/u/djones)\
**Post date:** [November 1, 2022, 5:33pm UTC](https://forum.inductiveautomation.com/t/perspective-horizontal-menu-passing-parameters/65392/3 "2022-11-01T17:33:50Z")

</div>

Yes, I am trying to pass a custom property.

Essentially I have a view that i want to re-use. I'd like to pass a parameter to the view through the horizontal nav.

---

<div class="post-metadata">

**Author:** ![Joe\_Seph](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joe_seph/32/40277_2.png) [@Joe\_Seph](https://forum.inductiveautomation.com/u/Joe_Seph)\
**Post date:** [November 1, 2022, 9:21pm UTC](https://forum.inductiveautomation.com/t/perspective-horizontal-menu-passing-parameters/65392/4 "2022-11-01T21:21:11Z")

</div>

Can you post screen shots of the configuration of your component? How are you navigating to the other views?

---

<div class="post-metadata">

**Author:** ![michael.howe](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@michael.howe](https://forum.inductiveautomation.com/u/michael.howe)\
**Post date:** [July 20, 2023, 3:34pm UTC](https://forum.inductiveautomation.com/t/perspective-horizontal-menu-passing-parameters/65392/5 "2023-07-20T15:34:59Z")

</div>

Any chance we can resurrect this question? I'd like to use the horizontal menu to call up the same page from multiple options, each with a different tagPath page parameter (e.g. "Robot 1" "Main/Robot/R1", "Robot 2" "Main/Robot/R2"...).

---

<div class="post-metadata">

**Author:** ![David\_Nicks](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@David\_Nicks](https://forum.inductiveautomation.com/u/David_Nicks)\
**Post date:** [June 15, 2024, 3:47pm UTC](https://forum.inductiveautomation.com/t/perspective-horizontal-menu-passing-parameters/65392/7 "2024-06-15T15:47:09Z")

</div>

I had a similar issue and developed a fairly decent workaround.

In my situation, I have a parent view with an embedded view that is used to host custom content for equipment that is organized in a hierarchy. There is a session custom prop that points to the id of the current location in the hierarchy, and the embedded view path is bound to a query that uses that id to return the path to a corresponding sub-view.

The horizontal menu is bound to a query that uses the same id to return data about all the children of the current location - which could be 0 or dozens of children, so the built-in scrolling of the horizontal menu has much better functionality than a flex repeater.

I found that I could set the `target` property of each menu item to the corresponding id of that location, capture that in the `event.target` argument of the `onItemClicked` event for the menu, and there update the session prop value. This worked perfectly in Designer, although I did have to cast the id to a string to store it in the menu props, and cast the string back to an int to store it in the session prop, no biggie.

Unfortunately, in a browser, I discovered that the menu still forced a navigation, which, of course, failed. I was hoping there would be a way to abort the default navigation in the `onItemClicked` event, but so far I haven't figured out how.

My workaround exploits the behavior of a menu item that has sub-items. These parent menu items don't navigate, but they do still carry the `event.target` value to the `onItemClicked` handler. I found that by adding a "phantom" child item to each top-level item, which is disabled, blank, and transparent, it _almost_ does exactly what I want.

```python
phantom = {
		'enabled' : False,
		'target' : "",
		'items' : [],
		'icon' : {},
		'label' : "",
		'style' : {'opacity' : 0}
		}

```

The only artifact is the blue selection highlight that appears and disappears if the user repeatedly clicks the same item. This is relatively subtle and unobtrusive.

_ **One significant caveat:** _ This only works smoothly with a single-level horizontal menu. If you add submenus and apply this same technique to the submenu items, the submenu does not disappear after the click event. The user has to click on the parent menu item again to close the submenu, which is obviously a pain. I've even gone so far as to reset the menu items property to an empty list (in my case it gets rebuilt immediately based on the property binding) and the submenu still stays open.

So, to sum, hijack the target prop of the menu items and store your parameters there. Add a phantom sub-item to each of these parent items to suppress the navigation behavior. Capture the target value in the `onItemClicked` event and there you can script whatever behavior you want, whether it's your own `system.perspective.navigate` call, or setting a property value elsewhere that stuff is bound to, or something else.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [June 17, 2024, 7:14am UTC](https://forum.inductiveautomation.com/t/perspective-horizontal-menu-passing-parameters/65392/8 "2024-06-17T07:14:14Z")

</div>

You are gonna be better of to use the title and / or path as a key to a list of variables/params. than trying to use the target

---

<div class="post-metadata">

**Author:** ![bwhite](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bwhite/32/7112_2.png) [@bwhite](https://forum.inductiveautomation.com/u/bwhite)\
**Post date:** [June 26, 2024, 5:21pm UTC](https://forum.inductiveautomation.com/t/perspective-horizontal-menu-passing-parameters/65392/9 "2024-06-26T17:21:05Z")

</div>

Has there been any good fix for this that doesn't leave the submenu open? I would like to open a parameterized window from the horizontal menu component with sub menus.

---

<div class="post-metadata">

**Author:** ![james\_7205](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@james\_7205](https://forum.inductiveautomation.com/u/james_7205)\
**Post date:** [May 5, 2025, 4:14pm UTC](https://forum.inductiveautomation.com/t/perspective-horizontal-menu-passing-parameters/65392/10 "2025-05-05T16:14:34Z")

</div>

Hi, Re-visiting this one.  
Is there a way to pass parameters to sub-menu item (pages) utilizing a single parameterized view?
