[Compound widget] Open Dialog box

I’m creating a compound widget for a sensor status and when that compound widget is pressed a dialog box need to be opened to control that sensor. Now I’m creating an eventbinding with the cliensystem.action.OpenDialog, every time i’m using the compound widget.

But I would like to integrate this into my compound widget. I know from the help that clientsystem.Actions are not supported within an compound widget. But I was wondering if anybody has found a workarround for this?

I think that if you bind this action to a session variable (Value change action) connected to a button within this compound widget, it could work like that, but I’m not sure if it’s the right solution for you.

1 Like

That sounds like a solution, but since we are needing quite a lot of dialogboxes, this sounds like quite a lot of work.

And how will you use the compound widget, will be included any active widgets in it? Or this will be only variable monitor?

The Compound widget constist of several imagelists, to show a statussens (e.g. manual mode, automatic mode, interlock, on/off) and an text output for the name of the component.

For example, the compound widget shows a motor status, so it has text output for the name, an imagelist with colors to show status (on/off/alarm) and an image to show its interlocked status. All information is binded to this compound trough an StructureBindableProperty.

If you don’t have any active buttons or inputs, you can use a classic click event in the event binding file to open the dialog box. A compound widget functions externally like any other widget.

If you need to connect multiple items within a single compound widget, it’s better to use an OPC UA structure, which you can connect as a node.

I’m aware that I can use a click event, but I have to handle that clickevent ‘outside’ of the compound widget. And I want to handle the event (OpenDialogBox) inside the compound widget.

It is not possible to use system events and actions in a compound widget. So in the end you have to program a lot of code around the compound widget to interact with dialogs.

The only way to have this a little bit streamlined is creating communication actions and events that you trigger from/evaluate in the Compound Widget.
Via the triggered action you can then show the clicked on data in a shared dialog that sends the result via an event over a session variable, and other event on that session variable, back to the compound widget itself, which then sends the call to the sensor.

1 Like

If it is an option you could also use PLC code to handle this. Create a dialog specific variable / structure and use a pointer, which you update to point to the selected sensor when the user clicks on a sensor in HMI.

This way you can use a single dialog with all of the sensors, the drawback is that it needs PLC code, and is not a nice way to handle this if you need multiple clients at the same time. (Multiple clients can also be handled but requires an array with an index for each client).

Hi Rens, have you find the best solution for you? can you make for us short summary?

Nope. Not yet. Since all the propose solutions require PLC or external interference, I have not implemented anything yet.

The best solution so far, I think, is the propsal from @phaehnel. So change a value/session var within the widget, which triggers the dialog opening.

1 Like

Ok I marked @phaehnel answer as a possible solution, if you find better one, please keep us updated :slight_smile:

1 Like