NetTalk Central

Author Topic: Back/Forward browser button errors out  (Read 5654 times)

alex.kolaric

  • Full Member
  • ***
  • Posts: 151
  • Do it or do not, there is no try
    • View Profile
    • Email
Back/Forward browser button errors out
« on: March 24, 2011, 10:35:56 AM »
Hi,

when I use back/forward browser button and resend request for some form I get error message that record is not found. I tested example applications coming with Nettalk and the problem is there too. Here is the example screenshot.

Need help. Is there any solution for this.

Alex



[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11245
    • View Profile
Re: Back/Forward browser button errors out
« Reply #1 on: March 24, 2011, 10:18:08 PM »
Don't use the browser forward and back button.
For security reasons you can't go "back" to a form anyway.

cheers
Bruce

alex.kolaric

  • Full Member
  • ***
  • Posts: 151
  • Do it or do not, there is no try
    • View Profile
    • Email
Re: Back/Forward browser button errors out
« Reply #2 on: March 25, 2011, 02:17:48 AM »
Hi Bruce,

it is ok for me not to allow going back to the form for security reasons. However, is it possible to give some different message/information page which won't look like there is something wrong with web application. My employers are thinking that the web server code is written poorly cause this kind of message is displayed to the end user.

Thanks,
Alex

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11245
    • View Profile
Re: Back/Forward browser button errors out
« Reply #3 on: March 25, 2011, 09:57:40 PM »
Hi Alex,

yes you can override the message.
When it occurs, the message is placed in the Value 'alert' with a call that looks something like this;

self.SetValue('Alert','record not found ...

So in the form, you have some code like this;

  if  sub(p_web.GetValue('alert'),1,10) = 'record not'
    p_web.SetValue('Whatever')
  end

I'll look into making a more elegant way for future builds, but this should do for now.

cheers
Bruce



alex.kolaric

  • Full Member
  • ***
  • Posts: 151
  • Do it or do not, there is no try
    • View Profile
    • Email
Re: Back/Forward browser button errors out
« Reply #4 on: March 26, 2011, 01:49:23 AM »
Hi Bruce,

thanks for the help. It will be sufficient for now.

Regards,
Alex

alex.kolaric

  • Full Member
  • ***
  • Posts: 151
  • Do it or do not, there is no try
    • View Profile
    • Email
Re: Back/Forward browser button errors out
« Reply #5 on: March 26, 2011, 02:26:00 AM »
Bruce,

what would be the most appropriate embed within the orm to add the code. I was trying few of them and all I succeeded was hat popup message shows the text I want. However the text on the top of the page was not changed.

Thanks,
Alex

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11245
    • View Profile
Re: Back/Forward browser button errors out
« Reply #6 on: March 28, 2011, 12:17:33 AM »
I have created a new method in the WebHandler in build 5.21 called .SetAlert.
This is called to set the 'alert' value when the value is set from inside the class.
So you can override it in the WebHandler method.

You can embed your own SetValue before the parent call (based on the pMessage parameter) and then RETURN _before_ the parent is called.

this should be out later today.

cheers
Bruce

alex.kolaric

  • Full Member
  • ***
  • Posts: 151
  • Do it or do not, there is no try
    • View Profile
    • Email
Re: Back/Forward browser button errors out
« Reply #7 on: March 28, 2011, 01:02:32 AM »
Thank you very much.

Regards,
Alex