I would really like a “Stay on Page” property in the Web Session.
If You go to the “Eddys” demo on the xojo.com site: (http://demos.xojo.com/cgi-bin/orders/orders.cgi#10046)
Any you then hit the browsers back button You get a nice dialog that asks if you wish to leave the site.
Was this added to 2013?
The WebSession.ConfirmMessage property was added in 2011r2, but we only started using it with the Eddie’s Electronic’s sample project in 2013r1.
This one has been very useful. We tend to set the message when we’re in an edit state (or not saved). It at least keeps users from accidentally leaving the site or quitting the browser.
I also put the following code in the app.HTMLHeader section… which keeps the ‘Backspace’ key from causing the browser to go ‘Back’ should the user accidentally not have the cursor in a textfield/textarea at the time. This helps…
if(event.keyCode==8 ¦¦ event.keyCode==13)
<body onkeydown="return checkShortcut()">
<input type="text" onFocus="x=true" onBlur="x=false">
Eric, I don’t see any “HTMLHeader” property in the App class? Am I being stooopid? Or do you use the Session.PrepareSession event to insert your script into the HTMLHeader?
In the app inspector,bottom item.
Would it be possible to set an event instead of a property to manage this inside our apps ?
That said, a solution must be found to prevent the user from accidentally leaving the application. The “ConfirmMessage” is not appropriate.
What is possible in the state?
Why is the ConfirmMessage not appropriate? That’s what the browsers offer us for this functionality.
By unappropriate, I meen that the way of displaying the message is not in the app.
[quote=19660:@Eric Brown]I also put the following code in the app.HTMLHeader section… which keeps the ‘Backspace’ key from causing the browser to go ‘Back’ should the user accidentally not have the cursor in a textfield/textarea at the time. This helps…
Can a body tag be placed in the HTMLHeader?
From what I see the Body stuff does not stay in Head, but simply gets merged with the normal Body.
So I just tested it…
<body style="margin: 0px;" onload="Xojo.begin('318FA780279DAD2464758B32C20DFD76')" onorientationchange="Xojo.view.sizing.rotated()">
Doesn’t seem to be in the right place…
No. You can’t put a body tag in the header. Any “merging” you are seeing is being done by the browsers themselves. And the behavior will likely be different on different browsers.