1. Stefan Tischner
  2. PowerBuilder
  3. Thursday, 28 May 2020 09:32 AM UTC

Hi,

when the program detects an error while saving, I want to place the focus on the column (and row) where the error occurred. This works quite well with one exception: If the focus is on a DW button in the DW to be marked, both SetColumn and SetFocus return 1, but the focus remains on the DW button. If the focus is on a column in the DW or outside the DW, everything is fine.

By removing the tab order from the button I can prevent the focus from landing on the button, of course. But then not all elements can be reached by the tab key. Is this the way it should work?

Best regards,

Stefan

Olan Knight Accepted Answer Pending Moderation
  1. Friday, 29 May 2020 23:01 PM UTC
  2. PowerBuilder
  3. # 1

HJave you tried POSTING the SetFocus()?
I find that resolves a lot of issues.

Olan

Comment
  1. Stefan Tischner
  2. Thursday, 4 June 2020 06:34 AM UTC
Yes, I have. It was one of Chris' suggestions (see further down).
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 28 May 2020 16:28 PM UTC
  2. PowerBuilder
  3. # 2

Hi Stefan;

   It could be that other event's are still firing and their PowerScript is still running so that your CB focus request is being interrupted and/or over-ridden. I would like to suggest that you try another approach on your CB code, as follows:

CB - Approach #1:

  • IF DC.Update() <> 1 THEN
  •    Yield ()
  •    DC.SetColumn ("????")
  •    DC.SetFocus ()
  • END IF

CB - Approach #2:

  • IF DC.Update() <> 1 THEN
  •    DC.POST SetColumn ("????")
  •    DC.POST SetFocus ()
  • END IF

 HTH

Regards ... Chris

 

Comment
  1. Stefan Tischner
  2. Friday, 29 May 2020 06:42 AM UTC
Hi Chris,

thanks for your reply. Unfortunately, neither approach works. #1 yields the same result as before, #2 sends the focus outside the DW (I even don't see the focus.). When I click on the DW, the focus shows up on the button again.

I don't know what's going on behind the scenes but since we use the PFC process for saving, the error occurs during of_validation (in a nonvisual object) far before Update. So it seems unlikely to me that there are interferences with other events.



Regards,

Stefan
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 29 May 2020 15:03 PM UTC
Hi Stefan. Tanks for trying that alternative. Sorry that did not work for you.

My next suggestion is to open a Support Ticket and export the DWO Source (into an SRD file) and attach this to the ticket. I would then suggest a simple Test Case PB App that uses that DWO and tries to perform the same process. From there, we can look deeper into your weird issue.

Regards ... Chris
  1. Helpful
There are no comments made yet.
John Raghanti Accepted Answer Pending Moderation
  1. Thursday, 28 May 2020 13:24 PM UTC
  2. PowerBuilder
  3. # 3

What if you move the button to the window and take it off of the dw?

Comment
  1. Stefan Tischner
  2. Thursday, 28 May 2020 13:44 PM UTC
Unfortunately, this is not an option in this case. There are three buttons each belonging to a column to show a list for multiple selection. With single selection it would be a drop-down list… We also use other forms of multiple selection always showing the whole list, but in this case space matters too. :-(
  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.