Page 1 of 2

Setting focus to a widget

Posted: Tue Sep 20, 2016 12:21 pm
by mwalter
I have a small popup panel that contains two input controls. One text box and a drop down. The text box has some javascript in the OnBlur event that basically clicks a hidden button that returns control to the RPG. The RPG will then build the data for the drop down based on the value in the textbox. This is all working fine, however, I cannot seem to get the cursor to stay on the drop down. I tried binding the tab index to two fields in my application and setting them, initially to 1 for the text box and 2 for the drop down. Then when the drop down is filled, I reverse it and set the text box index to 2 and the drop down to 1. I also tried setting focus to the drop down widget after the button click in the OnBlur event in the text box.

Regardless of what I do, the cursor jumps back to the text box.

Any ideas?

Thanks,

Mark.

Re: Setting focus to a widget

Posted: Tue Sep 20, 2016 2:20 pm
by Glenn
Mark,

I would try binding an RPG variable to the 'set focus' property of the drop down and then turn it on when you are done with the logic that loads the drop down. The next EXFMT should put the focus on the drop down.

Glenn

Re: Setting focus to a widget

Posted: Wed Sep 21, 2016 12:38 pm
by mwalter
That did it. Thank you.

Re: Setting focus to a widget

Posted: Thu Mar 16, 2017 3:02 pm
by mwalter
Having this issue again. I have a format with one field and 4 buttons. I've set a variable bound to the set focus property and set the tab index to 1. When the format displays, the cursor is not being placed in the field.

Re: Setting focus to a widget

Posted: Thu Mar 16, 2017 3:24 pm
by Glenn
The tab index shouldn't have any effect. What sort of 'field' is it? A textbox? If it's the only textbox on the screen it should get focus without you having to do anything.

I just did a simple test on version 5.7 with multiple textboxes and it seems to work as expected for me.

Glenn

Re: Setting focus to a widget

Posted: Thu Mar 16, 2017 3:46 pm
by mwalter
Yes, a textbox and it's not getting focus. It's the only textbox on the screen.

Re: Setting focus to a widget

Posted: Thu Mar 16, 2017 4:02 pm
by Glenn
There is a 'no focus' setting on the record format. If that isn't set and there are no other things such as custom JavaScript that might be changing the focus please submit a support request to support@profoundlogic.com.

Glenn

Re: Setting focus to a widget

Posted: Fri Mar 24, 2017 11:51 am
by pjshuey
Mark,
I am having this same problem. Let me know what support tells you. Thanks!
Patti

Re: Setting focus to a widget

Posted: Fri Mar 24, 2017 2:41 pm
by Glenn
Patti,

I believe Mark had the 'no focus' property set. Is this property set on your screen also?

Glenn

Re: Setting focus to a widget

Posted: Fri Mar 24, 2017 3:08 pm
by pjshuey
No, I did check that. This is something that is so simple, and I just don't see what the issue is...