Hi all,
I wanted to propose an enhancement that I believe would significantly improve how we handle data across multiple embedded views within Ignition. If you already have a clean solution for this hurdle, feel free to share.
Let me explain the use case:
Current Challenge:
When you have a complex view with multiple layers of embedded views (let's say 2 or 3 levels deep) and several embedded views in total (e.g., 10 or more), there are challenges in efficiently sharing data between these views.
For example, imagine one of the embedded views selects a filter that needs to be applied across all other embedded views. Right now, you can use Perspective's sendMessage
to broadcast this filter, but that approach is not stateful. This means you need to pass on that selected item through all layers of embedded views when a view appears without an event. This results (at least for me) in allot of custom properties an orchestration function in my parent view, and makes it a bit hard to maintain, passing these properties along to all embedded views.
Workarounds:
- Session Properties: A possible workaround is to store the filter in session properties. This works well because it's easy to modify and access from any view, and Ignition handles event processing for you. However, the downside is that you lose the ability to open the same page multiple times with different filters.
Proposed Solution: Custom Page Props
Would it not be beneficial to have custom page properties that act like global variables but are limited to the current page? These custom page props would allow stateful data sharing across all embedded views within the same page, without the limitations of session properties and without allot of maintaining effert. This way, users could open the same page multiple times with different stateful data (like filters), making it much more flexible in dynamic and complex applications.