NetTalk Central

Author Topic: Close Button on form  (Read 3825 times)

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Close Button on form
« on: October 14, 2013, 10:00:27 AM »
Hi,

Is there anyway to execute code (in this case delete a session value) when the user clicks the Close button on a Form.    I know nothing is actually closed;  the browser just retrieves a new page, and the user can avoid the Close button by just calling a new page directly.

The intent is to deal with the browse tab/instance data integrity vulnerability by stopping users from opening another form if they haven't used the Save, Cancel, or Close to exit the last time they used the form.

Thanks.     

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Close Button on form
« Reply #1 on: October 14, 2013, 09:46:24 PM »
Close button on the form? Are you sure you meant Close? Close buttons only appear on a form in View-Only mode...

cheers
Bruce

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: Close Button on form
« Reply #2 on: October 15, 2013, 10:09:51 AM »
Thanks, Bruce

Yes, in view only mode.  My thinking was that even though a form is in view only mode it still shares the same form queue as an editable version of the same form on another tab.

 But in thinking about it more, if the session value is only created/deleted in editable forms,  a view only instance of the form could not be opened if the editable form had not been saved or cancelled. And if an editable instance of form is opened in another browse tab after a view only instance was opened, none of the changes made to the editable form will be saved to the view only record, so it doesn't matter.

 Not exactly great UI, but it will have to do.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Close Button on form
« Reply #3 on: October 16, 2013, 10:03:33 PM »
so, the short answer is no, the link that comes from the browser is just the "new page request". To get more information than that would require javascript code being added to the close button. (and I guess the OK and Cancel buttons.)

Cheers
Bruce

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Close Button on form
« Reply #4 on: October 16, 2013, 10:04:08 PM »
but you would be able to "see" that the close button was pressed in the WebHandler....

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: Close Button on form
« Reply #5 on: October 17, 2013, 09:46:46 AM »
Thanks, Bruce.  Where would I see it in the Web Handler?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Close Button on form
« Reply #6 on: October 17, 2013, 10:39:11 PM »
ProcessLink method, before parent call - whatever you can see in the incoming log has been parsed at that point and is in the Value queue etc.

cheers
Bruce