When dismissing a dialog, how can I set the focus on the calling form? Is clicking the calling form the only way?

There is a weird bug in Power Objects that I also ran across when creatingexamples for my book, Mastering Oracle Power Objects. I wrote codeto bring up a dialog box whenever users entered a particular data field,and I wanted to return them to the next data field when they closed thedialog. I couldn’t get this to work, no matter what I tried.

A very helpful gentleman on the OPO team gave me a great workaround. If Iused the SetFocus() method before I left the the originalfield, the focus would return to the specified field. This works well inmy situation, and may in yours. It seems the focus sometimes gets’lost’ when you go to a dialog.

I hope this technique works for you.


About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist