# Parameter for view's context?

**URL:** <https://forum.inductiveautomation.com/t/parameter-for-views-context/28793>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 3, 2019, 4:55pm UTC](https://forum.inductiveautomation.com/t/parameter-for-views-context/28793 "2019-10-03T16:55:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan\_Bridgeman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dan_bridgeman/32/3610_2.png) [@Dan\_Bridgeman](https://forum.inductiveautomation.com/u/Dan_Bridgeman)\
**Post date:** [October 3, 2019, 4:55pm UTC](https://forum.inductiveautomation.com/t/parameter-for-views-context/28793/1 "2019-10-03T16:55:21Z")

</div>

Is it possible to tell the what context a view is in when an action is performed? For example, if a button as an actionPerformed script, could I examine some property of the object or the event which would tell me if the view was the primary view of a page, or if it was embedded inside another view?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 9, 2019, 8:09pm UTC](https://forum.inductiveautomation.com/t/parameter-for-views-context/28793/2 "2019-10-09T20:09:58Z")

</div>

Not unless you’ve manually specified a hard-coded value for the View’s path. bindings against `page.props.primaryView` will return the path of the View from the `Perspective/Views` directory.

So, in theory, if you supply a custom property key of “path” for your view node and you supply the known path to that View, then you could perform the following check:

```auto
if self.view.custom.path == self.page.primaryView:
    # do something

```

**BUT**  
This will only tell you if the Primary View for the page is the View in question, and there is every possibility that your primary View has an instance of your View embedded within it somehow, such that

ViewA has some components, and at least one of them is an embedding component, and that embedding component is rendering another instance of ViewA.

In this event, your check will pass as the instanced View has the same path as the primary View for the page.

**TLDR** ; There is no way to know with 100% certainty whether your “current” View is the primary View of a page.

---

<div class="post-metadata">

**Author:** ![Dan\_Bridgeman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dan_bridgeman/32/3610_2.png) [@Dan\_Bridgeman](https://forum.inductiveautomation.com/u/Dan_Bridgeman)\
**Post date:** [October 10, 2019, 3:12pm UTC](https://forum.inductiveautomation.com/t/parameter-for-views-context/28793/3 "2019-10-10T15:12:01Z")

</div>

That all makes sense. Thank you for the explanation.
