Dialog and Session

Good afternoon.

I’m trying to show a dialog. Getting session not available method. I have the session identifier available to me. How do I get the dialog to appear?

dim d as aDialog

d = new aDialog() // error occurs here.
d.show()

Thank you.

-Bob

What is the error?

Tim,

I may have fixed it. I added this:

aSession = app.SessionWithIdentifier(pSessionID)

before I invoke the class that shows the dialog. it worked. I have some more testing to do, but so far so good.

Thanks.

-Bob

Where are you trying to show the dialog that you don’t have the session ?

[code]dim d as aDialog

d = new aDialog
d.show

[/code]

I think your issue may simply be coming from the parenthesis. Where do they come from any way ?
http://documentation.xojo.com/index.php/Webdialog

A correction:

The line of code that fixes the problem is:

dim context as new WebSessionContext(app.SessionWithIdentifier(pSessionID))

That is having that line makes the problem go away. What is odd is that context is not actually used. In fact the the compiler reports an “Unused local variable” warning.

You should not need a WebSessionContext if your code is in a WebPage. Once again, from WHERE are you calling the code ?