1. P Scalfano
  2. PowerBuilder
  3. Tuesday, 27 February 2018 12:45 PM UTC

It am using Powerbuilder 2017 R2.  I have a button on my datawindow.  When I click the button the ItemFocusChanged event on the datawindow is triggering. 

Per the PB help "In the ItemFocusChanged event, dwo is always a column control. Therefore, you can get more information about it by examining any properties that are appropriate for columns such as dwo.id and dwo.Name"

This is causing issues in my code because it is doing exactly what is stated above 'examining properties appropriate for columns'.  I am getting a system error because the properties do not apply to a button.  

In version 12.5, the event is not firing. I do not have an install of any of the versions in between (12.6 or PB 2017). 

Is this a known issue?

 

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 27 February 2018 14:21 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi;

   I just tested this in PB 2017 R2 using the following code on the ItemFocusChanged Event ...

Parent.title += Space (2) + "|" + Space (2) + String ( dwo.name )

Results:

  • Nothing changes in the parent Window title when I click on any CB in the DWO as long as their TAB Order is Zero (0).
  • The ItemFocusChanged event does fire when the CB's Tab Order is > Zero (as I would expect when CB's became tab enabled in 12.x).

So one way to stop your extra focus changed event firing is to set the CB's tab order = 0.  - OR -

You can also just change your code in the IFCE to check the DWO argument pointer's object type before processing.

HTH

Regards ... Chris

 

Comment
  1. P Scalfano
  2. Wednesday, 28 February 2018 11:25 AM UTC
Thanks Chris! I went back and checked my 12.5 test and it did not have the button in the tab order. The help is misleading - maybe you can get that updated :)
  1. Helpful
There are no comments made yet.


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