Hi all,
I'm currently working on a user management page and I'm working on a 'Remove User' button. In this button it calls an 'openPopup' function to ask the user to confirm that they want to remove the selected user. The problem I'm running into is the message handler will be ran with the last instance of the control variable not the one returned in the 'payload' object of the given call.
This is the script on the button:
def runAction(self, event):
system.perspective.openPopup('myPopupId', 'areYouSureView', position = {'left':100,'top':100})
if self.getSibling("Main_User_table").custom.didSelect == True:
system.user.removeUser("workingAlone_DB", self.getSibling("Main_User_table").custom.user)
system.perspective.sendMessage('refresh')
else:
system.perspective.sendMessage('refresh')
this is the message handler that is on a table component:
def onMessageReceived(self, payload):
self.custom.didSelect = payload['didSelect']
and this is the scripting action on the button on the popup page:
def runAction(self, event):
system.perspective.sendMessage(messageType='didSelect',payload={'didSelect':True},scope='page')
system.perspective.closePopup('')
I'm not sure how to either access the payload in the scripting of the button itself or how to force the script to wait until the message handler has received its new values (or some other way to make this function ).
Thank you,
Cam