Hello
I want to show some session related data to the user.
I tried to do this in the Buildpage method this way:
However, this won't work, as page.ws.Session returns a Null in this stage of the ABM page loading process.
I fixed it by creating an empty label, and in the Websocket_Connected event I put:
This works fine, except that a user sees a empty webpage for half a second, and then the data is injected onto the page. Expected, but I don't think that's a very elegant solution. Is there a way to get session data before the page is send to the user?
If this is impossible, is there a way to show some kind of loading animation while the webpage is still busy connecting to the websocket?
Thanks for any help provided.
I want to show some session related data to the user.
I tried to do this in the Buildpage method this way:
B4X:
Dim lblUserID As ABMLAbel
lblUserID.Initialize(page, "lblUserID", page.ws.Session.GetAttribute("userid"), ABM.SIZE_H1, False, "")
page.Cell(1,1).AddComponent(lblUserID)
However, this won't work, as page.ws.Session returns a Null in this stage of the ABM page loading process.
I fixed it by creating an empty label, and in the Websocket_Connected event I put:
B4X:
Dim lblUserID As ABMLabel = page.Component("lblUserID")
lblUserID.Text = page.ws.Session.GetAttribute("userid")
lblUserID.Refresh
This works fine, except that a user sees a empty webpage for half a second, and then the data is injected onto the page. Expected, but I don't think that's a very elegant solution. Is there a way to get session data before the page is send to the user?
If this is impossible, is there a way to show some kind of loading animation while the webpage is still busy connecting to the websocket?
Thanks for any help provided.