Solved Impromptu MessageDialog
-
Is there anyway to prompt on-the-fly message box (MessageDialog), and inspect the results, rather than declare a MessageDialog for every message we want to show/ask user?
-
You can declare one MessageDialog and then change the text/title properties for different messages.
-
@xargs1 Yes, it's the solution I have to do now for OK button dialog, but if the action after the messagebox depend on what user answer is still depend onAccept() or onYes(), onNo(), then I have to implement its own MessageBox
-
Add to the MessageDialog:
property var onYesFunc property var onNoFunc onYes: onYesFunc() onNo: onNoFunc()
then you can set onYesFunc/onNoFunc just as you set the text.
-
@xargs1 OK, I will try that. Thanks
-
@xargs1 It works! Thank you very much
-
@xargs1 I am curious wonder how it can work. onYesFunc is a property. How can we call it as a function in the onYes handler?
-