Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New interesting demo available
#1
Hi guys,

Recently I've been asked on how to enable the back button in an IntraWeb app and have it working as it was an HTML web site. I came up with this demo that I've just published showing  how to accomplish that (it requires some bits released on IW 15.2.57):

https://github.com/Atozed/IntraWeb/tree/...ltiPageApp

Key points:

- The application works as a Multi-page application, MPA (opposed to SPA, Single Page Application). MPA have multiple URLs (e.g http://yourdomain/newcustomer http://yourdomain/checkout, etc). On the contrary, traditional SPAs have a single URL

- One key difference between MPA and SPA is how they respond to the back button. In general, hitting the back button when in a SPA application will take you to another page, outside the scope of the application. On the other hand, MPAs respond correctly to back and forward buttons and will take you to the previous or next page in the browser history, inside the application scope. Also, URLs of a MPA app can be bookmarked

- This application makes use of content handlers to handle the URL addresses of the application. Each form has its own URL.

- There is no special code required other than the creation of the content handlers and setting a single property in the ServerController

- Everything should just work as expected. Have a look at the comments in the source code as it contains some important information on how to switch between forms and how to create the content handlers

Enjoy!  Big Grin
Reply
#2
Hi Alexandre,

Running your demo (using Chrome 102.0.5005.115) I see the following

* Start the application. F9 to start a browser session
* MainForm is shown. Press button [Go to SecondForm]
* SecondForm is shown with correct url. Now press the browser back button.
* MainForm is shown. But now again press button [Go to SecondForm]
* The SecondForm is NOT shown. I have to press the button [Go to SecondForm] for a second time to show the SecondForm
Reply
#3
(06-13-2022, 05:35 PM)jeroen.rottink Wrote: Hi Alexandre,

Running your demo (using Chrome 102.0.5005.115) I see the following

* Start the application. F9 to start a browser session
* MainForm is shown. Press button [Go to SecondForm]
* SecondForm is shown with correct url. Now press the browser back button.
* MainForm is shown. But now again press button [Go to SecondForm]
* The SecondForm is NOT shown. I have to press the button [Go to SecondForm] for a second time to show the SecondForm


Jeroen, It works perfectly for me in all tested browsers.
I'm assuming you are not on IW 15.2.57, is that correct? As is mentioned on the demo application's main form, it needs a few bits introduced in version 15.2.57.
Reply
#4
Hi Alexandre,

No, I used IW15.2.57 
Attached is a screen recording showing the issue.


Attached Files Thumbnail(s)
   
Reply
#5
I get the same results as Jeroen with Chrome and Edge. For me on startup it works correctly the first time but fails on subsequent attempts (first click nothing, second click shows SecondForm).
Reply
#6
Something is fishy... I got different results. I'll check what's happening and will get back to you guys
Reply
#7
Something to note - while testing using DevTools (F12) in Edge:  if 'Disable Cache' is enabled the demo works correctly 100% of the time, if 'Disable Cache' is disabled the extra click behavior is reproducible.

[Image: clip0001.png] 
Reply
#8
Hi Mark (according to mjs.us Smile),

Good debugging!

I see the same: If Chrome or Edge Devtools is open AND Network | Disable cache is checked, the browsers back button works as expected.
If I close DevTools or uncheck Network | Disable cache then the problem is as described.
Reply
#9
>>Good debugging!

It's a necessary skill for me, sometimes I create a lot of bugs.
Reply
#10
Setting PostRedirectGet = prgEnabled in the ServerController seems to make it work for me under all circumstances.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)