Xojo2023r3 When WebDialog is instanciated?

I have web page that is using web dialog, so I have added web dialog component to it (it shows as little icon at the bottom in the IDE).
I can show this web dialog using Show method.

In Xojo2018 I think the web dialog component is instanciated when the web page is open as I was able to set variables in the web dialog before invoking Show method to show it.

In Xojo2023r3 it seems that this is not the case. Can someone please help me to understand this?

Background: this is a typical scenario where the web page shows the list and user needs to drill in the list line to open dialog on which there is some additional info to enter and save in the database.

Well, you can set properties of course.

The WebDialog Constructor runs when the page is created.
And the WebDialog Opening event runs when you show the dialog.

not sure about this one …

OK, here is the issue:
In my web dialog in the Event Handler Open/Opening (Xojo2018/Xojo2023r3) I have following code:
mFileFormatId = New NumberField
mFileFormatId.Name = “mFileFormatId”

The web page opening this web dialog sets some properties (aka variables such as mFileFormatId) and then does Show the web dialog. In Xojo2018 my web dialog upon Show had mFormatId populated with the number value as expected whereas in Xojo2023r3 the mFormatId shows nil.

This suggests to me that the mFormatId is initialized when invoking Show method to open the web dialog. If that is the case then I need to set the mFormatId property after doing Show.

There are few more properties that needs to be set in addition to mentioned mFormatId.

Looks like webdialog is firing Shown twice (Issue #74412):

Well, firing Show is one issue.
What about Opening? Should this event be fired every time when Show is invoked?

I thought that Opening is fired only once when parent web page is open.

My test project did fire Opening multiple times. I tried it before answering!
The button on the dialog would call self.hide.

Like this:

So opening for dialog runs every time I click the button to open dialog.

Sub Pressed() Handles Pressed
  System.DebugLog CurrentMethodName
  WebDialog11.Label2.Text = "Hello World"
  WebDialog11.Show
  
End Sub

Great, thanks for confirmation. Now that I understand how it works I can change the old code to work.

I don’t know if Opening should fire every time, but this is the case, even if the dialog is already showing and you do another dialog.show it will fire the opening event:

Code:

System.DebugLog("WebPage Shown")
firedialog
timer.CallLater(5000, AddressOf firedialog)
timer.CallLater(10000, AddressOf firedialog)