Using system.gui.conirm

Good afternoon all,

I am wanting to use the system.gui.confirm on a performed action. I cannot get it to work, says that I am missing attribute gui.

Please help.

def runAction(self, event):
	This event is fired when the 'action' of the component occurs.

		self: A reference to the component that is invoking this function.
		event: An empty event object.
	data = self.getSibling("DateTimePicker").props.formattedValue
	category = "HMI"
	source = "ASCADA Client"
	usr =
	message = str(usr) + " Changed END OF SHIFT to " + str(data)
	data9 = usr 
	if system.gui.confirm("Are you sure you want to shutdown the plant?",
	"Really Shutdown?"):
			"data": data
			#Update Syslog		
			"category": category,
			"source": source,
			"message": message,
			"data9": data9
This text will be hidden

system.gui functions are Vision only.

1 Like

Is there an alternative or is it easier to just code it?

There’s no direct analogue. You’ll have to move to some kind of asynchronous replacement approach. For instance, open a popup view. Pass a message handler name or payload into the popup.
In the popup, if the user confirms, broadcast a message.
Then in the message handler, invoke your named query (in this case).
There’s no support for a generic “invoke this callback” function approach (yet), unfortunately.

This is an area where we plan to make some improvements, but no timeline.

1 Like