[Question] Pages and Views

According to the “basic” structure for Perspective, we should have all views tied to a page, with at least one view as the “main”, correct? Can there be situations where views don’t need to be designated to a page?

https://docs.inductiveautomation.com/display/DOC80/Perspective+Sessions

Absolutely.

If you examine the system.perspective.navigate() method, you’ll notice that you can specify “view” as a parameter. Using this method in this manner will leave you on your current “page” (including leaving the url intact), but will swap out the underlying View with the target View from the method invocation.

For a demo, you can place the following Views in your project:

Repl.json (933 Bytes)
ReplTwo.json (1.0 KB)

You should then make a Page Configuration for the Repl View. If both Views are at the Perspective/Views level of your project, you are now good to go, otherwise you’ll need to right-click the button in the “Repl” view, select Configure Events, and update the path to the “ReplTwo” view accordingly.

In a Session, navigate to the Repl view and then click the button.

1 Like

Also, I would imagine views would be used as templates have been in Vision, since there is no dedicated template-like thing in Perspective?

@mrogers: Sort of.

You can use the View as an embedded View and pass it parameters - much like the templates from Vision. Just like in Vision templates, changes to the View used in the Embedded View will show up in any uses of the View.

However, also just like in Vision, you are unable to DIRECTLY modify this embedded View. Remember, Embedded Views are Components, not Containers.

1 Like