PowerBuilder object loses focus

Hi,

I'm working on an adopted PowerBuilder app that does the following steps in a window:

      Inserts a new row (insert is triggered from menu item)
      Validates mandatory fields of the new row before save
      Returns a message if there is missing info
      Returns to the insert screen with focus on the failed validation object

All other windows in the app do this fine, but this new window (which has several bugs) will not hold the object focus after the validation message - it focuses on the 1st object (which has correct data) instead. During debug, the focus is on the object that failed validation, then somewhere during the last steps it loses it's setting - this is where maybe a suggestion could come in (i.e. what attribute should I check for).

There is an incredible amount of behind the scene work redrawing 18 tab selection windows - making it difficult to figure good breakpoints.  Haven't recognized a pattern of the good windows vs. this new window so following the good guys hasn't helped.

Any thoughts, suggestions?

Thank you!
ssebringAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sandeep_patelCommented:
Hi,

First you search for 'POST'. Might be dw_1.Post SetColumn('abc') OR dw_1.Post SetRow(1) is used.

So what happens is post will put this command in message queue and once your script is over it agains sets focus on the said column and row. If this window is inherited from other window then there are possiblity that it is done in ancestor also.

And as you said it redras tab selection search for Post SelectTab(). Inshort POST must be creating the problem.

Regards,
Sandeep
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
diasroshanCommented:
Hi,

just to add to what sandeep said... look for setcolumn or setfocus... these methods are responsible for setting focus...

if nothing seems to help and ur finding it like hell to hunt for the bug... take the easy route...

last line of code write...
dw_1.SetFocus()
dw_1.SetColumn('<ur columnname>')


Cheers,
Rosh
0
ssebringAuthor Commented:
I should have asked sooner!  By searching POST I was able to narrow the issue down quickly, compare the broken event with one of the 'good guys' and find the culprit statement.  So easy.  Thank you! Also thank you to Rosh for the alternative direction.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.