I have a WebDialog AccountMaintenance_Dialog that has a WebButton whose Caption can change. When the Caption = Delete then I want to display another WebDialog DeleteUser_Dialog
This dialog asks the user are they sure they want to delete? This second WebDialog DeleteUser_Dialog has two WebButtons ‘Cancel’ and ‘Delete’. Both call a Method DeleteUser after setting To_Delete_or_Not_to_Delete either as False or True respectively and the Method DeleteUser returns a Boolean.
I thought I was setting this up to enable AddHandler in AccountMaintenance_Dialog but cannot set the AddHandler statement correctly before showing DeleteUser_Dialog
I have setup the following in AccountMaintenance_Dialog but the AddHandler fails when Analyzed. A syntax error is returned on AddHandler req.DeleteUser WeakAddressOf req.
Dim req As New DeleteUser_Dialog
AddHandler req.DeleteUser WeakAddressOf req
req.Show
'-- Get returned value and see if we should delete
If req.To_Delete_or_Not_to_Delete Then
'--some code
End
I have attempted many variations to get this to compile and run but have not been successful.
I have also read several threads on this topic and looked at the example Advanced - AddHandler - AddHandler.xojo_binary_project which uses a Timer and cannot make heads or tails of how to use this for what I need.
So how does one setup to wait on a second dialog to perform an appropriate action?
Let me restate what I am trying to do in a WebDialog
I have a WebDialog1 and a WebDialog2
WebDialog1 is placed on a WebPage and when the User selects Delete from WebDialog1 WebDialog2 is displayed and WebDialog1 is on hold waiting for a response from WebDialog2.
Then in WebDialog2 the User selects either Cancel or Delete (This could be implemented either as two separate WebButtons or a WebPopupMenu either will do.
Then after the User makes their selection WebDialog2 informs WebDialog1 and now WebDialog1 continues checking the response from WebDialog2
Does that make sense and if so how can this be accomplished?