1. John Michael Tejano
  2. PowerBuilder
  3. Thursday, 3 August 2023 02:09 AM UTC

Good day!

I am using the STD Framework, I have this datawindow, it queries data from the database including the bit datatype and I changed the style type of the bit field to checkbox. How to bypass this warning dialog box, since I don't have any intention of saving any data from the datawindow. I already unchecked the Allow Updates in the Rows -> Update Properties.

Thank you in advance!

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 3 August 2023 02:50 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi John;

  The tracking of pending updates is managed by the DataWindow Control (DC) and not the DataWindow Object (DWO). That's because any App can swap DWOs "on the fly" or use the Modify() command to make a DWO updateable dynamically. So the framework relies on the DW Control to validate this at Window close.

  The DC has an extended property named "ib_save_required". You can set this on/off in the painter that contains the DC or at runtime for example as DC.ib_save_required = True/False.

HTH

Regards... Chris 

Comment
  1. John Michael Tejano
  2. Friday, 4 August 2023 04:46 AM UTC
Hi Chris,

I tried unchecking it in the painter but to no avail. I tried also at runtime and this error occurred.

Error C0158: The property 'ib_save_required' was found in class 'dw_1', but insufficient rights are available to access it.

  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 4 August 2023 15:49 PM UTC
Hi John;

I have no issues checking or unchecking this property in any DC at the "concrete" (working) level. Please make sure that you point the painter to that location to change that property setting.

That extended property is a "Protected" instance variable. So from the coding POV you would need to add the code to the DC itself. I would suggest using the "oe_postconstructor" event. On the DC then, your code would be ...

THIS ib_save_required = False

I'm getting the PB R2 "official" framework version ready this month (I have a beta on Source Forge already for the PB 2022 R2 release), but I think that I'll add a public "of_Set_SaveRequired()" method to the DC ancestor so that you can call that from any object class to make it more coding flexible. ;-)

Regards ... Chris
  1. Helpful 1
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.