1. Pete Yankovich
  2. PowerBuilder
  3. Thursday, 5 March 2020 14:44 PM UTC

I need help checking for unsaved changes when selecting different tab in tabpage.

Olan Knight Accepted Answer Pending Moderation
  1. Friday, 6 March 2020 00:40 AM UTC
  2. PowerBuilder
  3. # 1

Are you checking for changes in a DATAWINDOW? An SLE? A MLE? a test field?

Checking the status of the DW is easy with the GetItemStatus call.
For all other updateable object types, I would:
 - set an instance variable at the TABPG level 'ib_tabpg_updated", initialized to FALSE
 - each time one of these objects on that tabpg is modified, set that instance variable to TRUE

When the user selects a  new TAB, put code in the SelectionChanging event to see if that instance variable is TRUE, and if so then allow the user to SAVE or stay on the current tabpage.


Olan

Comment
There are no comments made yet.
David Peace Accepted Answer Pending Moderation
  1. Thursday, 5 March 2020 15:24 PM UTC
  2. PowerBuilder
  3. # 2

Hi

You need to fire off the check for saving data in the SelectionChanging Event on the tab control. You can check the DW status and if needed update it, do not forget to do an Acceptext on the DW first to make sure all the data has been entered.

If either of tthese fail you can stop the user selection the new tab with a Return 1.

Hope this helps

David

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.