1. Jakob Schrödel
  2. PowerBuilder
  3. Thursday, 10 June 2021 14:07 PM UTC

We have a custom user object (visual) with a custom editmask control on it.
Another window is creating this UO if the Enter Key is pressed.
On initialization of the UO there is a editmask.POST SetFocus() called.
in the editmask.keydown event i can read the pressed key (keycode) for example "1" correctly.

We have the strange behavior that if we wait a bit after pressing the Enter key until the UO is visible everything works as it should: Focus lands in the editmask, pressing 1 key executes keydown and the correct value appears in the Editmask.
But if we press Enter followed by our input key very fast: still the setfocus seems to work, still the keydown event gets executed BUT the pressed value does not appear in the Editmask. It seems that the Userobject already exists, the EditMask already exists and it's events can be called but the visual part of it is not there yet and so the value pressed gets lost. Any clue how that can be possible?

-> Under Powerbuilder 8 this worked as it should no matter how fast you pressed the buttons. My suspicion is that the handling of the POST somehow changed or that there is a distinction between visually initalized and non-visually initialised?

Thankful for any clues/hints on this one!

 

Cheers Jakob

Jakob Schrödel Accepted Answer Pending Moderation
  1. Tuesday, 15 June 2021 11:27 AM UTC
  2. PowerBuilder
  3. # 1

Hi Chris

Hi Olan

 

Thanks a lot for your inputs. It helped me to unterstand the scale of the problem much better. I tried some of your suggestions but there was no quick success so i opted for the following workaround:

I recorded all the keystrokes which were numbers via the keydown event of the editmask to make sure no digits are lost. On saving the data i compared this to what the visual part of the editmask says and warn the user if there is a difference. 


Thanks a lot!

Jakob

Comment
  1. Armeen Mazda @Appeon
  2. Tuesday, 15 June 2021 13:48 PM UTC
Thanks for sharing the solution!
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 10 June 2021 15:23 PM UTC
  2. PowerBuilder
  3. # 2

Hi Jakob;

   Yes, there have been many "slight" event and even O/S message timing changes to PB & even MS-Windows since PB version 8.0 was released. There were some key event changes in PB10.2, 11.6, 12.6, and 2017 that have altered the event firing sequence of various built-in and user "mapped" events in the PB runtime.

  My suggestion (in fact, an approach I always do in my frameworks) would be to disable the DW Control (or entire dialogue) and show an HourGlass! mouse pointer when the dialogue 1st opens. Then set the mouse pointer to an arrow! and enable the DW Control in the "Posted" event to show the App user that all is now "good-to-go".

Food for thought.  HTH
Regards ... Chris

 

Comment
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Thursday, 10 June 2021 14:21 PM UTC
  2. PowerBuilder
  3. # 3

One work-around might be:
Constructor event:  add SetRedraw (FALSE),  and optionally open the object as NOT VISIBLE.

PostOpen event:  add SetRedraw (TRUE) and make the object visible.


And like you, I don't know why the behavior differs between PBv8 and PB20xx.

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.