WebSession.CurrentPage read only?

Xojo2013R2 on Win7.

The documentation is unclear about WebSession.CurrentPage property as read only or not.

I’m asking because I’m using this property for changing page from a timer action event and not from a webtimer.
This produce some strange results related to the events generated on the webpages.
Very often the Shown event of the page does not get called.

I suspect that also some other events does not get generated as required.
Sometimes I get an error dialog on the browser page like “Could not execute returned javascript: element is null” and at the same time “Warning: No Session object in context” logged in the debugger message window.

All of this is happening also with only one session active.
I’m supposing I’m using all the suggested directions when referring at the session with the session context in the action event of the timer.

The LR says very clearly that WebSession.CurrentPage is read-only. Then it says it gets or sets the current WebPage. Have you tried using WebPage.Show instead?

The property is read-only as WebSession.CurrentPage shows. I’ve just updated its text and updated the lock icon that was missing from the WebSession page.

But, on session open event , the currentpage is writable (session.currentpage = frmtest1). What is the difference with the above command and frmtest1.show, when it is executing on session open event ?

One important difference is that WebPage.Show is the documented of doing what you’re trying to accomplish. A lot has to happen to show a page. I can certainly understand why there’s a single preferred path for that.

I’d stick with WebPage.Show. And file a Feedback case for Session.CurrentPage allowing an assignment. I have no idea at this point if that is a doc error or a bug in the WebSession class.

Feedback case #28543

Thank you Paul for you suggestions.

Reading the docs examples it seems that this property was to be intended as read/write.

See the code example in the WebSessionContext documentation: there is an explicit use of Session.CurrentPage = New ExceptionPage.

I’m preparing a simple program to show that writing to this property could produce strange results as described in my first message of this conversation.

Regards

I have created Feedback case #28546 related to the problem reported in my first message.

So the problem it not related to the Session.CurrentPage but instead to WebPage.Show and/or WebPage.Close (I don’t know which one is causing the problem) called from a Timer (not WebTimer) Action event.

P.S.
I’m supposing I’m doing correctly all the WebContext related stuff.
The problem shows up also when only one session is active.

Regards