A Anser Well-Known Member Licensed User Longtime User Nov 28, 2018 #1 Hi, I do re-load the page by using the following code Code: Copy ABMShared.NavigateToPage(ws,"" ,"./") This is reloading the page, but it is still reading from the Cache hence the charts/graphs are not refreshed with the new values. Here are the log entries that are generated when I call ABMShared.NavigateToPage(ws,"" ,"./") Code: Copy Disconnected Inside Build page Connected Waiting for value (7 ms) UpdateFromCache: TargetService36deaf6d-2872-4012-95c0-b52da9f65fe2 Reading from cache Comes from cache Waiting for value (8 ms) TargetService36deaf6d-2872-4012-95c0-b52da9f65fe2 Whereas if I refresh the page using the reload button available in the Chrome, then the contents (Charts) are refreshed with the new values. Now my question is : Is there any way to avoid the cache willingly when I call Code: Copy ABMShared.NavigateToPage(ws,"" ,"./") I did not find any other methods like page.reload. I even tried page.row(1).Refresh but no result.
Hi, I do re-load the page by using the following code Code: Copy ABMShared.NavigateToPage(ws,"" ,"./") This is reloading the page, but it is still reading from the Cache hence the charts/graphs are not refreshed with the new values. Here are the log entries that are generated when I call ABMShared.NavigateToPage(ws,"" ,"./") Code: Copy Disconnected Inside Build page Connected Waiting for value (7 ms) UpdateFromCache: TargetService36deaf6d-2872-4012-95c0-b52da9f65fe2 Reading from cache Comes from cache Waiting for value (8 ms) TargetService36deaf6d-2872-4012-95c0-b52da9f65fe2 Whereas if I refresh the page using the reload button available in the Chrome, then the contents (Charts) are refreshed with the new values. Now my question is : Is there any way to avoid the cache willingly when I call Code: Copy ABMShared.NavigateToPage(ws,"" ,"./") I did not find any other methods like page.reload. I even tried page.row(1).Refresh but no result.
alwaysbusy Expert Licensed User Longtime User Nov 28, 2018 #2 you have to set the pageID (second param) in ABMShared.NavigateToPage(ws,"" ,"./") so that it can be removed from the cache. Upvote 0
you have to set the pageID (second param) in ABMShared.NavigateToPage(ws,"" ,"./") so that it can be removed from the cache.
A Anser Well-Known Member Licensed User Longtime User Nov 28, 2018 #3 When we reload the page like this way Code: Copy ABMShared.NavigateToPage(ws, ABMPageId,"./") The browser back button has to be clicked twice to go back to the previous page. Is this the normal behavior ? Or is there any other trick to resolve this, so that it works like the normal page Upvote 0
When we reload the page like this way Code: Copy ABMShared.NavigateToPage(ws, ABMPageId,"./") The browser back button has to be clicked twice to go back to the previous page. Is this the normal behavior ? Or is there any other trick to resolve this, so that it works like the normal page
alwaysbusy Expert Licensed User Longtime User Nov 28, 2018 #4 Anser said: When we reload the page like this way Click to expand... Where do you do that (in a button click or so?). I can't reproduce your problem with the back button. Works fine in our apps. Upvote 0
Anser said: When we reload the page like this way Click to expand... Where do you do that (in a button click or so?). I can't reproduce your problem with the back button. Works fine in our apps.
A Anser Well-Known Member Licensed User Longtime User Nov 28, 2018 #5 alwaysbusy said: Where do you do that (in a button click or so?). Click to expand... I use the Reload button on the Chrome browser Upvote 0
alwaysbusy said: Where do you do that (in a button click or so?). Click to expand... I use the Reload button on the Chrome browser
alwaysbusy Expert Licensed User Longtime User Nov 28, 2018 #6 Ok, but where have changed ABMShared.NavigateToPage(ws, "","./") to ABMShared.NavigateToPage(ws, ABMPageId,"./")? Upvote 0
Ok, but where have changed ABMShared.NavigateToPage(ws, "","./") to ABMShared.NavigateToPage(ws, ABMPageId,"./")?
A Anser Well-Known Member Licensed User Longtime User Nov 28, 2018 #7 In the Class Globals, I added Private ABMPageId As String = "ts" Code: Copy Sub Class_Globals Private ws As WebSocket 'ignore ' will hold our page information Public page As ABMPage ' page theme Private theme As ABMTheme ' to access the constants Private ABM As ABMaterial 'ignore ' name of the page, must be the same as the class name (case sensitive!) Public Name As String = "TargetService" '<-------------------------------------------------------- IMPORTANT ' will hold the unique browsers window id Private ABMPageId As String = "ts" ' your own variables End Sub In the RadioGroup Click event, I call ABMShared.NavigateToPage(ws, ABMPageId,"./") as shown below Code: Copy Sub radiotrgttype_Clicked(Target As String) Dim radiotrgttype As ABMRadioGroup = page.Component("radiotrgttype") nTargetType = radiotrgttype.GetActive() ws.Session.SetAttribute("TargetType", nTargetType ) 'Reload the page ABMShared.NavigateToPage(ws,ABMPageId ,"./") End Sub When I do a page reload with ABMShared.NavigateToPage(ws,ABMPageId ,"./"), to go back to the previous page using the Chrome browsers' back button, the first click does not takes to the previous page, instead I have to repeat the back button click once more Last edited: Nov 28, 2018 Upvote 0
In the Class Globals, I added Private ABMPageId As String = "ts" Code: Copy Sub Class_Globals Private ws As WebSocket 'ignore ' will hold our page information Public page As ABMPage ' page theme Private theme As ABMTheme ' to access the constants Private ABM As ABMaterial 'ignore ' name of the page, must be the same as the class name (case sensitive!) Public Name As String = "TargetService" '<-------------------------------------------------------- IMPORTANT ' will hold the unique browsers window id Private ABMPageId As String = "ts" ' your own variables End Sub In the RadioGroup Click event, I call ABMShared.NavigateToPage(ws, ABMPageId,"./") as shown below Code: Copy Sub radiotrgttype_Clicked(Target As String) Dim radiotrgttype As ABMRadioGroup = page.Component("radiotrgttype") nTargetType = radiotrgttype.GetActive() ws.Session.SetAttribute("TargetType", nTargetType ) 'Reload the page ABMShared.NavigateToPage(ws,ABMPageId ,"./") End Sub When I do a page reload with ABMShared.NavigateToPage(ws,ABMPageId ,"./"), to go back to the previous page using the Chrome browsers' back button, the first click does not takes to the previous page, instead I have to repeat the back button click once more
A Anser Well-Known Member Licensed User Longtime User Nov 28, 2018 #8 Anser said: I use the Reload button on the Chrome browser View attachment 74810 Click to expand... In the post #5 of this thread, I have used the word "Reload" instead of "Back button" and highlighted (yellow) the wrong button too. I think I need some rest Here is the correct image Hope it is clear to you now. After reloading the page programatically using ABMShared.NavigateToPage(ws,ABMPageId ,"./"), I cannot go back to previous page with one single click using the back button in the browse, instead I have to click the back button twice. In the first click it will reload the same page itslelf Upvote 0
Anser said: I use the Reload button on the Chrome browser View attachment 74810 Click to expand... In the post #5 of this thread, I have used the word "Reload" instead of "Back button" and highlighted (yellow) the wrong button too. I think I need some rest Here is the correct image Hope it is clear to you now. After reloading the page programatically using ABMShared.NavigateToPage(ws,ABMPageId ,"./"), I cannot go back to previous page with one single click using the back button in the browse, instead I have to click the back button twice. In the first click it will reload the same page itslelf
alwaysbusy Expert Licensed User Longtime User Nov 28, 2018 #9 Apart from your back button problem (but maybe it helps), this is very bad: Code: Copy Private ABMPageId As String = "ts" You should leave the existing ABMPageID you've got from ABMPageId = ABM.GetPageID(page, Name,ws) in Websocket_Connected. If you use something fixed like 'ts', then you cannot have multiple users going to the same page without destroying each others data. Upvote 0
Apart from your back button problem (but maybe it helps), this is very bad: Code: Copy Private ABMPageId As String = "ts" You should leave the existing ABMPageID you've got from ABMPageId = ABM.GetPageID(page, Name,ws) in Websocket_Connected. If you use something fixed like 'ts', then you cannot have multiple users going to the same page without destroying each others data.
A Anser Well-Known Member Licensed User Longtime User Nov 28, 2018 #10 alwaysbusy said: If you use something fixed like 'ts', then you cannot have multiple users going to the same page without destroying each others data. Click to expand... Thank you for correcting me. I changed as per your suggestion. Going back to the previous page with one single click on the Back button is still not resolved. It doesn't matter how many times you reloaded the page using ABMShared.NavigateToPage(ws,ABMPageId ,"./"), the back button on the browser needs to be clicked twice to go back to the previous page. Upvote 0
alwaysbusy said: If you use something fixed like 'ts', then you cannot have multiple users going to the same page without destroying each others data. Click to expand... Thank you for correcting me. I changed as per your suggestion. Going back to the previous page with one single click on the Back button is still not resolved. It doesn't matter how many times you reloaded the page using ABMShared.NavigateToPage(ws,ABMPageId ,"./"), the back button on the browser needs to be clicked twice to go back to the previous page.
alwaysbusy Expert Licensed User Longtime User Nov 28, 2018 #11 Something must be in your code preventing it the first time. As I said, in my projects it works fine. Upvote 0
Something must be in your code preventing it the first time. As I said, in my projects it works fine.
A Anser Well-Known Member Licensed User Longtime User Nov 30, 2018 #12 Is there a way/setting to make a particular page never load from cache ? ie always fresh loading Upvote 0
A Anser Well-Known Member Licensed User Longtime User Nov 30, 2018 #13 It looks like when a page is loaded from Cache, the Sub ConnectPage() is not executed. For eg, if you have a page.ShowModalSheet("login") in the ConnectPage, then it is not executed Upvote 0
It looks like when a page is loaded from Cache, the Sub ConnectPage() is not executed. For eg, if you have a page.ShowModalSheet("login") in the ConnectPage, then it is not executed
alwaysbusy Expert Licensed User Longtime User Nov 30, 2018 #14 Anser said: It looks like when a page is loaded from Cache Click to expand... This is correct and by design Upvote 0
Anser said: It looks like when a page is loaded from Cache Click to expand... This is correct and by design
A Anser Well-Known Member Licensed User Longtime User Dec 1, 2018 #15 Anser said: Is there a way/setting to make a particular page never load from cache ? ie always fresh loading Click to expand... Is this possible ?. ie Whenever a page is loaded, it should never load from cache ? Any specific setting to do this for a particular, I mean not for all the pages, ONLY for certain pages. My problem is that I have a Custom Login Page I have the following flow My Custom Login Page -> Home Page (Home page has Navigation bar to navigate to different pages) On all the pages I have a given the option to Logoff ON the NavigationBar TopItem. If the user clicks on it it should log off and then the Login page with the Login prompt should appear Code: Copy page.NavigationBar.AddTopItemEx("AppLogOff", "Logout", "mdi-action-input", "", ABM.VISIBILITY_ALL,ABM.COLOR_WHITE, "", ABM.ICONALIGN_LEFT) On each and every page's Page_NavigationbarClicked, I have the following code Code: Copy ' clicked on the navigation bar Sub Page_NavigationbarClicked(Action As String, Value As String) ' saving the navigation bar position page.SaveNavigationBarPosition If Action = "AppLogOff" Then ABMShared.AppLogOff(page) Return End If ABMShared.NavigateToPage(ws, ABMPageId, Value) End Sub This is the code for AppLogOff in ABMShared Code: Copy Sub AppLogOff(page As ABMPage) 'ignore ' do whatever you have to do to log off your user page.ws.Session.SetAttribute("UserID", 0) page.ws.Session.SetAttribute("AppType", "") page.ws.Session.SetAttribute("DirectLogin", 0) Dim LoginPageID As String LoginPageID = page.ws.Session.GetAttribute("LoginPageID") NavigateToPage(page.ws, LoginPageID, "../Login/index.html") End Sub In the Sub AppLogOff() I should call the Login Page. I do not know how to get the PageID of the LoginPage inside ABMShared so that I could call for a page reload avoiding the cache. The login modal sheet is in the ConnectPage() of Login. To overcome this issue what I have done is that In the Login page's ConnectPage() I save the PageID to a session variable and then in the Sub AppLogOff(), I use the saved PageID to reload the Login Page. I do not know whether what I have did is the correct way. OR Is there a better way to do this. Upvote 0
Anser said: Is there a way/setting to make a particular page never load from cache ? ie always fresh loading Click to expand... Is this possible ?. ie Whenever a page is loaded, it should never load from cache ? Any specific setting to do this for a particular, I mean not for all the pages, ONLY for certain pages. My problem is that I have a Custom Login Page I have the following flow My Custom Login Page -> Home Page (Home page has Navigation bar to navigate to different pages) On all the pages I have a given the option to Logoff ON the NavigationBar TopItem. If the user clicks on it it should log off and then the Login page with the Login prompt should appear Code: Copy page.NavigationBar.AddTopItemEx("AppLogOff", "Logout", "mdi-action-input", "", ABM.VISIBILITY_ALL,ABM.COLOR_WHITE, "", ABM.ICONALIGN_LEFT) On each and every page's Page_NavigationbarClicked, I have the following code Code: Copy ' clicked on the navigation bar Sub Page_NavigationbarClicked(Action As String, Value As String) ' saving the navigation bar position page.SaveNavigationBarPosition If Action = "AppLogOff" Then ABMShared.AppLogOff(page) Return End If ABMShared.NavigateToPage(ws, ABMPageId, Value) End Sub This is the code for AppLogOff in ABMShared Code: Copy Sub AppLogOff(page As ABMPage) 'ignore ' do whatever you have to do to log off your user page.ws.Session.SetAttribute("UserID", 0) page.ws.Session.SetAttribute("AppType", "") page.ws.Session.SetAttribute("DirectLogin", 0) Dim LoginPageID As String LoginPageID = page.ws.Session.GetAttribute("LoginPageID") NavigateToPage(page.ws, LoginPageID, "../Login/index.html") End Sub In the Sub AppLogOff() I should call the Login Page. I do not know how to get the PageID of the LoginPage inside ABMShared so that I could call for a page reload avoiding the cache. The login modal sheet is in the ConnectPage() of Login. To overcome this issue what I have done is that In the Login page's ConnectPage() I save the PageID to a session variable and then in the Sub AppLogOff(), I use the saved PageID to reload the Login Page. I do not know whether what I have did is the correct way. OR Is there a better way to do this.