Hey,
I am trying to hide and show a compound widget from within itself, triggered by the change of a bound variable.
This is some example code of what I would like to achieve, but it doesn’t work in the current form:
When using an event binding, no opcUa, session and clients system events are permitted, only events that comes with the widgets, so directly it wouldn’t be possible.
One workaround I did in the past, was to use and invisible widget (one that can bond with an numeric value), and detect when value changes and then set the overall visiblity based on the output of the said invisible widget.
I took a look at help regarding the local properties , and it seems that the event ValueChanged of local properties can be responded in the event binding of the compound widget. For more information, the link above is set the help page regarding that,
I don’t know whether it is possible to set the entire CompoundWidget invisible inside itself.
You could put all widgets of CompoundWidget in a GroupBox and set it invisible or change style of Widgets.
But place in content will be always be reserved for pseudo invisble CompoundWidget.
Thanks for your answer. Sadly I have to control the visibility of all Compound widgets indivually, so I cant group them.
But one thing I found, if you put the compound widgets inside of a FlexLayoutPanel no gaps are existant when making Widgets invisible.
Ah ok, now I understood. In this case your point with the reserved space stands, because the widget didnt really changed for the overlying MappView Content.
After a bit of further experimenting and talks with B&R Support I managend to find what I was looking for.
Although (I think) not documented anywhere, it is possible to access the local property visible and probably others the same way you can access self created local properties.
This means you can hide the entire compound widget from within itself, just like from outside, with this action:
I already had the discussion with B&R Support in France about this, you have the possibility to use this to set invisible the compound widget but you cannot set him visible afterward.
As Support say me, this feature should be available in AS6.
I cannot confirm this. Of course you cannot react to button clicks when the compound widget is invisible. But you can still react to value changes of e.g. DropDowns and change the visibility that way.
The change you are talking about is probably this: