1. Joe Hess
  2. PowerBuilder
  3. Monday, 6 July 2020 14:08 PM UTC

Migrating from PB9 to PB2019

The closequery event of my sheet ancestor calls a response window prompting the user to save changes if the datawindow has been modified. This works when I close the sheet. However, when the sheet is open and I close the frame, the response window appears, but the application continues to close. The user is not given the opportunity to respond.

This worked in PB9. I'm guessing something has been changed/fixed since then.

 

Regards,

Joe Hess

 

Accepted Answer
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 6 July 2020 17:56 PM UTC
  2. PowerBuilder
  3. # Permalink

Are you sure that w_messages isn't window of type 'Main' for some weird reason?

Comment
  1. Joe Hess
  2. Monday, 6 July 2020 19:18 PM UTC
I'm on 2019 R2, Build 2328. I ran into the resize event issue. Some of the events seems to be firing in a different order, now. I'm not sure that is bad, but it is something I had to address.
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 6 July 2020 19:19 PM UTC
YW Joe
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 6 July 2020 19:29 PM UTC
Yes more people noticed event execution order has changed for some things.

Maybe the reason I did not have any resize problems AFTER Appeon's fix, might be that I'm on a newer version of PFC's and got lucky Appeon repaired things looking at that same PFC version. I'm using the (nearly latest) version which was created for 2017 or 2019 (can't remember).

regards
  1. Helpful
There are no comments made yet.
Arthur Hefti Accepted Answer Pending Moderation
  1. Monday, 6 July 2020 15:29 PM UTC
  2. PowerBuilder
  3. # 1

Hi

I assume you don't set the parent of the response window. Try setting it to the frame window.

Regards
Arthur

Comment
  1. Kevin Ridley
  2. Monday, 6 July 2020 15:40 PM UTC
If that doesn't work, I'd open up a support ticket. Not sure why you wouldn't make the sheet window the parent though instead of the frame.
  1. Helpful
There are no comments made yet.
Joe Hess Accepted Answer Pending Moderation
  1. Monday, 6 July 2020 15:41 PM UTC
  2. PowerBuilder
  3. # 2

I reference the frame in OpenWithParm:

li_Return = OpenWithParm(w_messagebox, lstr_Parms, GU_APP_ATTRIBUTES.uf_get_frame())

 

Does that not set the parent?

Joe

Comment
  1. Miguel Leeuwe
  2. Monday, 6 July 2020 18:14 PM UTC
I think that's correct, yes.
  1. Helpful
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Monday, 6 July 2020 15:52 PM UTC
  2. PowerBuilder
  3. # 3

Try this instead of the OpenWithParm:


// of_has_anything_changed() simply checks to see if any changes have been made. If you are using
// the PFC you can copy their code from pfcmain.pfc_w_master.pfc_updatespending(), otherwise you will need to
// check the status of each DW control and any other updateable objects you might have.

lb_changed = of_has_anything_changed()

IF (lb_changed) THEN

   li_Return = MessageBox ("Save?", "Would you like to save your changes, YesNo!, 1)
   IF (li_Return = 1) THEN
      // save your changes
   END IF
END IF

 

 

Comment
  1. Joe Hess
  2. Monday, 6 July 2020 18:02 PM UTC
Are you asking me to try this so we can continue to figure this out? I'm using a custom response window, not MessageBox.



  1. Helpful
  1. Olan Knight
  2. Monday, 6 July 2020 22:10 PM UTC
Yes. The issue seems to be that the separate object/window fails to lock the entire application with it's response window.



If this replacement works, it might be worth keeping, at least when closing the app.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 6 July 2020 18:36 PM UTC
  2. PowerBuilder
  3. # 4

I created a small (non pfc) template mdi template application in pb 2017 and then migrated it to 2019.

It all seems to work correctly when doing what you do.

Maybe, when you do the OpenWithParm of the message window, your "GU_APP_ATTRIBUTES.uf_get_frame()" is no longer working?

In my sample I've assigned the frame to a global variable "gw_frame", so I'm not calling any function when doing the openwithparm.

See the attached sample to see what I mean. (pb 2019 r2).

 

regards.

Attachments (1)
Comment
  1. Joe Hess
  2. Monday, 6 July 2020 19:05 PM UTC
I think I see the issue. There is a custom event on the frame capturing PBM_SYSCOMMAND. The script checks to see if the close button on the control menu was clicked. If so, it posts a custom close event, UE_CLOSE which just has CLOSE(THIS). For some reason this event executes in PB2019 even though the response window is up.



I added a method to close the active sheets before posting the event. That seems to work.
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 6 July 2020 19:18 PM UTC
Probably because the PBM_SYSCOMMAND runs in the background somehow.

Was this event also present in pb 9? Maybe it's more of a different behaviour due to running on W10?

Great you found the solution though.

regards.
  1. Helpful
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.