I noticed in this thread: Scroll scrollbar to position via script that there was a vertical scroll memory for the Vision module but is there one for Perspective?
I think this came up before and the answer was "No".
Thanks for the response. Seems like Perspective module should get it before Vision due to webpage interactions.
What do you mean by this?
Vision has this kind of functionality because jython scripting runs right there in the client, and has full access to the entire Java Swing object model. Perspective does not because its scripting runs in the gateway, and has no access whatsoever to the browser's DOM.
Ahh I see, so what would you suggest I do?
Good luck. None of this is trivial.
It depends on what problem you are trying to solve.
Keep your user experience consistent with normal browsing experience.
Trying to solve scroll memory with System Functions python scripting. The significance of the feature does not justify the time it will take to learn how to inject JS and use it. At leased at this point in my understanding of Ignition.
Sure, but what was the original user requirement? Why did you need to scroll to a position and was it on a view or on a table? You might be able to solve it using a filter to reduce a table's data, for example.
Yeah I did not clarify. I am using a view that has multiple embedded views within it. It will continue to get larger in size as we continue to expand in size. Its basically a snapshot of the entire plant with all of its machines scattered across the page in a vertical layout. Each machine functions as a button that, when clicked, will open its respective page.
Is your goal to set the scroll position, or is your goal to scroll a certain component into view?
... and, I presume, the problem to be solved is how to return to the plant overview in the same position you departed from.
- Open the machine view in a modal popup.
- Open the machine view in a new browser tab. The problem with this is that there is no way to close the tab with a button on the view. See Closing browser window from button in perspective? - #6 by PGriffith.
- Add an embedded view into each of the embedded machine views. Toggle the visibility of this when the machine is selected. (To avoid a performance hit you may need to disable updates on all the collapsed views somehow.)
Remember the scroll position before opening a new page so that when you go back it will place you in the position you were at before
Another thing I noticed that is very annoying and seemingly unfixable (for now) is when you have a table that you scroll to see some value, when the table data refreshes, the scroll position resets to the top. When using the table for anything but the trivial use case (i.e. using a subview or embedded views in the columns), this gets to be a big problem. We literally got another ticket right before I started typing this comment about this issue - our users ask about it all the time.
Those are good ideas. I feel like there is a scripting function that might retain the location on the page then pass it as a param to the new page. Then use a back button with that param value or something
I think you might need to recalibrate your feelings. When were they last checked?
I'll have to add a 'feelings check' policy in my next version launch
There is a way to manage this - sort of.
If your "navigation" to these Embedded instances was able to pass along a
domId value, or use a
domId from somewhere toward the top of the instance, then when you perform navigation you could use
url navigation to specify the
This results in the page scrolling to the target by it's unique identifier.
- Named embedded view DomId => "navBack"
- Clicked on a button within that embedded view which opened a new page
- added a "Previous Page" button with a onClick event python script:
- This just took me back to the TOP of "master-view" which houses that embedded view with the domId I setup earlier. I should mention that the embedded view's location is halfway down the page.
I assume I have the URL syntax wrong
The extra slash is treating that
#navBack as a parameter or continuation of the URL. Remove the slash.