1. Steen Jakobsen
  2. PowerBuilder
  3. Friday, 20 May 2022 15:44 PM UTC

Hi,

 

How can I detect when a row in the drop down datawindow is selected or the dropdown is closed?
when the scrolls up and down using the keyboard the the ItemChanged event is triggered so that is not an option

Basically I need a way to run come code when a row in the dropdown is selected.  And NOT while the user scrolls up/down

What event can I map to get notified when a selection is made or the dropdown is closed.

Thanks :-)

 

ps. using 2019R3

John Fauss Accepted Answer Pending Moderation
  1. Friday, 20 May 2022 16:03 PM UTC
  2. PowerBuilder
  3. # 1

Try mapping to event ID pbm_dwclosedropdown.

I've not tried it, but the event ID's name seems to suggest what you're looking for.

Please let everyone know if this works.

Comment
  1. Steen Jakobsen
  2. Friday, 20 May 2022 16:04 PM UTC
John, I tried that already .. it does not fire. Any clue ?
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 20 May 2022 16:42 PM UTC
Hi Steen ... It's been working in my STD framework for around 10 years now. Also, I use the "pbm_dwndropdown" event along with the "pbm_dwclosedropdown" event to control (track) what state the DDDW is actually in. Note: I had to script this DDDW state tracking a using a bit more PowerScript - in order to for it to work 100%. You can see the code in my framework's "vs_dc_master" object class (DC base ancestor) located in the "STD_FC_Base.PBL" library. You can also see this code "in action" in the framework's OrderEntry Demo App (check out the App log tracing for this while the App is in DEBUG mode). HTH

Regards ... Chris
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 20 May 2022 17:50 PM UTC
  2. PowerBuilder
  3. # 2

Hi,

Many years ago, I did something similar, it was tricky but it worked.

(For example, I remember having to set Setredraw(true) in one of the events to make sure the dd list would refresh correctly).

I tried to find the old code but alas ...

I attach a small sample app. What calls my attention, is that with any of these events - having to do with the dropped / dropping down of the dw, the posted messageboxes ONLY show once you click somewhere on the window. I think this might be changed (mis)behaviour.

See attached.

 

Attachments (1)
Comment
  1. Steen Jakobsen
  2. Saturday, 21 May 2022 04:23 AM UTC
Thanks Miguel,



Much appreciated. I think that the event needed to catch a dropdown close is a missing feature. And I have tried many workarounds .. seems this is yet another know problem that dates back to pb 3-4 some 18 years back. All the workarounds did not wok (1 full day of work wasted)

So I decided to build something better my self :-) .. I will take a look at your sample later.

Thanks again

Steen

  1. Helpful
  1. Miguel Leeuwe
  2. Saturday, 21 May 2022 08:04 AM UTC
yw, there's several events that can be coded, but I've only posted a messagebox in one them, to show you how it'll only show up after you close down the dddw and then have to click somewhere in the window, (not even clicking on the button will show the message).

It might also be that messageboxes (even when POSTED) cause some kind of a problem, so I might still try to figure it out in another way). Debug stops also seem to be ignored in those events.

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.