How do I do this in Xojo

  1. 2 weeks ago

    Paulo C

    Nov 28 Brazil

    Hi, I'm migrating from VB6 to Xojo web and I would like to implement a decision modal form. In VB6 I use:

    Sub WaitForDecision()
        FormOptions.Show vbModal 'Pause execution
        Beep 'Executed only after FormOptions is unloaded
    End Sub

    I Think there are no Modal forms that pauses execution in Xojo web. How can I do this in Xojo?

    You have to create a WebDialog and implement the Dismissed Event using a method which is applied via AddHandler. The dialog.show does not stop code execution in a web app. So you have to implement further code in the dismissed event.

  2. brian f

    Nov 28 Pre-Release Testers, Xojo Pro Chilly California

    MessageDialog

    OR

    MsgBox

  3. Marc Z

    Nov 28 Pre-Release Testers, Xojo Pro, XDC Speakers Oregon

    You just need to create new modal-type window and open it with showModal:

    myWindow.showModal

    Not all window types can be modal (a document-type window, for instance, cannot be modal).

    Once you get the right type of window set (the options are on the window's Inspector pane), you can add controls such as textfields and checkboxes, etc. and the user can fill out the fields before closing the window.

    Important: you do need to make your own way for the user to close the window! That means at minimum you need to add two pushbuttons, one for cancel and one for save. Within the cancel one you'd add code such as self.close to close the window. Within the save button you'd need to save whatever information the user put into the window (store it in a global variable, perhaps) and then close the window the same way.

    If you don't do this, the window will remain open, blocking all other activity in your app, and the user won't be able to do anything else!

  4. Paulo C

    Nov 28 Brazil

    Thanks, but, My question is abaout Xojo Web apps.

  5. Paul B

    Nov 28 Pre-Release Testers, Xojo Pro Europe (UK, Somerset)

    You need toook at the webDialog in that case.

  6. Alberto D

    Nov 28 Pre-Release Testers, Xojo Pro

    MsgBox is available for web, that will pause execution until OK is pressed.
    For beep I found this post from Michel with some threads: https://forum.xojo.com/conversation/post/210658

  7. Daniel F

    Nov 28 Pre-Release Testers, Xojo Pro Answer Germany

    You have to create a WebDialog and implement the Dismissed Event using a method which is applied via AddHandler. The dialog.show does not stop code execution in a web app. So you have to implement further code in the dismissed event.

or Sign Up to reply!