FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
06-13-2023 09:28 AM - last edited on 06-19-2023 08:58 AM by ThorstenX
⚠️ Community Team: Message is related to user @Ievhen . User requests to delete a duplicate account ⚠️
Hello team,
How can I change view in screen from custom local-script, is it possible?
I checked the WebIQ Manual and the WebIQ Visuals Reference, and found nothing that could help me.
Thank you in advance for your help!
Solved! Go to Solution.
06-13-2023 12:09 PM
Closed.
After analyzing the source code, we managed to figure it out.
Here example for screen with default control name
shmi.ctrl(".screen").setView(1)
06-15-2023 09:52 AM
This works in most instances, but is not guaranteed at all, as all of the things happen asynchronously. You are however relying on your screen being initialized before your LocalScript is executed, this cannot be ensured however.
Instead, you should use shmi.onReady for that purpose like in this LocalScript from one of our demos:
https://demo.smart-hmi.com/demo-animation/js/custom-libs/local-scripts/shapeRotationExample.js
06-15-2023 09:53 AM
Also, you posted in the wrong forum - this is the one for Bosch Rexroth HMI hardware, not for WebIQ. The WebIQ forum can be found here (which is why you did only get a late reply): https://developer.community.boschrexroth.com/t5/Smart-HMI-WebIQ-Designer-and/bd-p/dcdev_community-dc...
06-19-2023 09:26 AM
Moved to SmartHMI forum