I have a tab container where I would like to render the tabs as a view using viewPath and viewParams .
In the view that I am supplying as view path I have a bidirectional, boolean view parameter, isEditing, that can be toggled with a button inside the view that will be embedded.
I'm running into an issue where I can toggle the parameter in the tabs property in the tab container component and the embedded view will receive the new value, but when attempting to toggle the parameter from within the view via the button there is no change.
Has anyone experienced this? I can supply screenshots as needed, I am on Ignition 8.1.28.
edit: Adding pictures and context
This image is of the embedded view for the tabs property on a tab container, toggling the isEditing will change the color (for testing) of the button based on the boolean value. Additionally, clicking the button changes the value of the boolean to its opposite (and changes the color..) this works as expected.
This image is the view where the tab container is located, toggling isEditing in the property editor works as intended and will change the color of the pencil icon reflecting the change. However, putting the designer in preview mode and hitting the pencil changes the value only within the embedded view, and will not make its way back to the isEditing property in the tree. This behavior works correctly where I have a different implementation of the same strategy, I've only observed it on the tabs property.
You probably need to set up message handlers and have your button in your embedded view send a message that is handled by the message handler to send the value outside of the embedded view.
Alternatively, the button could write to a tag to persist the value but that would reflect on all clients running on the gateway.
Yeah I understand message handlers would work as an alternative but I would expect the behavior of view params to be constant throughout their implementation, and bidirectionality would align to the rest of my project. I also try to stay away from message handlers for something like toggling a boolean, could be for naught though..
Yes, it is bit odd that the tab views don't have bidirectionality on the view params (like table cell views). I'm sure you have looked at other options, but just in case, here are some other options:
Session Props
If you really don't want to use a message handler and or tags, you could use a custom session prop. It might work well, especially if there are other things you want to communicate to the parent view.
Tab Container Body
If you don't need the edit button to be visible the whole time, you could just have a status icon in the tab header and put the edit button in the body of the tab, as it can access the parent view directly from there.
Flex Repeater
In the past, I have ended up using a flex repeater instead, as it does allow bidirectional binding on the view params. Then you just have the extra annoyance have having to also keep track of which tab is active, which you don't get for free, unlike the tab container.
Are you confirming that the view params for tab headers aren't able to be bidirectional?
But yes, all of your suggestions are valid alternatives, but due to the nature of my use case I need the edit button to be external to that parent view (dashboard component).
Thanks for the reply!
As a workaround, I've used a message handler so I can continue developing the project, but I am looking for someone from Inductive to chime in and confirm if this behavior is expected/intended..
Not many IA employees frequent this forum, and when they do, it is really a volunteer thing. This forum is not support. For official answers, contact support.
Good to note, since it's not mission critical and workarounds are available I'll hold off from contacting support and hope a volunteer effort happens in this topic.