# requestfocus bug?

**URL:** <https://forum.servoy.com/t/requestfocus-bug/132>\
**Category:** Classic Servoy\
**Created:** [June 11, 2003, 2:06pm UTC](https://forum.servoy.com/t/requestfocus-bug/132 "2003-06-11T14:06:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [June 11, 2003, 2:06pm UTC](https://forum.servoy.com/t/requestfocus-bug/132/1 "2003-06-11T14:06:06Z")

</div>

I have the following method:

> elements.adres.requestFocus();

When switching from Designer to browse mode and than start the method manually everything works fine.  
When I put the method onLoad on the same form, It won’t start! Bug?

---

<div class="post-metadata">

**Author:** ![maarten](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@maarten](https://forum.servoy.com/u/maarten)\
**Post date:** [June 11, 2003, 6:15pm UTC](https://forum.servoy.com/t/requestfocus-bug/132/2 "2003-06-11T18:15:27Z")

</div>

try using “onShow” method. (executes every time form shows)

“onLoad” only executes the first time it’s shown after solution is started.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/1X/363c5924e316baabbea11f046f1e2f3db64fbf70.jpeg) [@system](https://forum.servoy.com/u/system)\
**Post date:** [June 13, 2003, 11:41am UTC](https://forum.servoy.com/t/requestfocus-bug/132/3 "2003-06-13T11:41:41Z")

</div>

Oke that works!, but try to show the same form in a dialog!  
Then the onshow-method won’t start.

Is there a workaround??

---

<div class="post-metadata">

**Author:** ![maarten](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@maarten](https://forum.servoy.com/u/maarten)\
**Post date:** [June 13, 2003, 12:27pm UTC](https://forum.servoy.com/t/requestfocus-bug/132/4 "2003-06-13T12:27:39Z")

</div>

What should your “onShowMethod” do?

I just tested with a simple setfield, and that works.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/1X/363c5924e316baabbea11f046f1e2f3db64fbf70.jpeg) [@system](https://forum.servoy.com/u/system)\
**Post date:** [June 13, 2003, 1:04pm UTC](https://forum.servoy.com/t/requestfocus-bug/132/5 "2003-06-13T13:04:30Z")

</div>

I’m not quit sure what you mean!

What I want to achieve is that if I open a form in a Dialog, I want that my cursor begins in the first field.

How?

---

<div class="post-metadata">

**Author:** ![maarten](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@maarten](https://forum.servoy.com/u/maarten)\
**Post date:** [June 13, 2003, 1:21pm UTC](https://forum.servoy.com/t/requestfocus-bug/132/6 "2003-06-13T13:21:10Z")

</div>

Couple of questions:

What’s the view(record/list etc..) of the form you’re opening in the Dialog?  
What kind of field(global, column) do you want to focus on?  
In which part(header, body etc) is it positioned?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/1X/363c5924e316baabbea11f046f1e2f3db64fbf70.jpeg) [@system](https://forum.servoy.com/u/system)\
**Post date:** [June 13, 2003, 2:00pm UTC](https://forum.servoy.com/t/requestfocus-bug/132/7 "2003-06-13T14:00:34Z")

</div>

> What’s the view(record/list etc..) of the form you’re opening in the Dialog?

answer: View as record

> What kind of field(global, column) do you want to focus on?

answer: global field called: name

> In which part(header, body etc) is it positioned?

answer: In the body part!

---

<div class="post-metadata">

**Author:** ![maarten](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@maarten](https://forum.servoy.com/u/maarten)\
**Post date:** [June 13, 2003, 2:59pm UTC](https://forum.servoy.com/t/requestfocus-bug/132/8 "2003-06-13T14:59:25Z")

</div>

Seems that requestFocus doesn’t work properly within FormDialog.  
I’ve posted bugreport to dev. team.

Thanks.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [July 17, 2003, 9:12am UTC](https://forum.servoy.com/t/requestfocus-bug/132/9 "2003-07-17T09:12:54Z")

</div>

request focus handling should be much better in builds after RC4  
(every where so not only FormDialog)
