Referencing an instance of a webdialog

  1. 2 years ago

    Trevor C

    16 Jan 2018 Melbourne, Australia

    I have a webdialog that can be opened from several places within my webapp. This can open a second webdialog.

    After changes have been made within the second, I'm trying to run a method on the first before closing the second. But I need to be able to reference the instance of the first.

  2. Wayne G

    16 Jan 2018 Pre-Release Testers, Xojo Pro New Zealand axisdirect.nz

    Implement the dismissed event in the first instance for the second instance. Review https://forum.xojo.com/45343-web-dialog-needs-to-wait-for-another-web-dialog/p1#p368229

  3. Trevor C

    16 Jan 2018 Melbourne, Australia

    Hi Wayne, Thanks for your answer. I will use that in the future.

    However I'm trying to run code on the first dialog from the second. The example you referred me to runs code within itself.

    I do this all the time with webpages eg webpage.method

  4. Wayne G

    16 Jan 2018 Pre-Release Testers, Xojo Pro New Zealand axisdirect.nz

    Hi Trevor, I had assumed that you wanted to run a method in the first instance then close the second? The dismissed event is run before closing the second dialog, and has access to all controls, properties & methods in that instance. You could pass the "me" object to a method in the first instance for processing.

    Have you considered an interface for this?

  5. Trevor C

    16 Jan 2018 Melbourne, Australia

    No, I haven't. I haven't done anything using interface before. What would the advantages be?

    So, can I assume there's no way of referring to the code on the first while the second is closing?

  6. Wayne G

    16 Jan 2018 Pre-Release Testers, Xojo Pro New Zealand axisdirect.nz

    The dismissed event is called by the second instance. You are referring to a method in the first instance. You can execute a method in the first instance passing properties etc. from the second instance.

    If you wanted to execute a method in the parent object you would typically create an event in the child and handle that event in the parent.

  7. 5 days ago

    Trevor C

    Nov 7 Melbourne, Australia

    I know this post is old but I'm still trying to be able to refer to an instance of a webdialogue. Anybody have any new ideas?

  8. Michel B

    Nov 8 Pre-Release Testers, Xojo Pro RubberViews.com

    Very simple: use a Webdialog property. Instead of DIMming your WebDialog, do something like:

    myPalette1 = New Palette1

    Where myPalette1 is a property of your WebPage:

    myPalette1 as Palette1

    and Palette1 is the name of the WebDialog.

    Then you can do something like

    Webpage1.myPalette1.close

or Sign Up to reply!