# Field Gaining Focus

**URL:** <https://forum.servoy.com/t/field-gaining-focus/5392>\
**Category:** Classic Servoy\
**Created:** [January 25, 2006, 8:52pm UTC](https://forum.servoy.com/t/field-gaining-focus/5392 "2006-01-25T20:52:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![monetteboy](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@monetteboy](https://forum.servoy.com/u/monetteboy)\
**Post date:** [January 25, 2006, 8:52pm UTC](https://forum.servoy.com/t/field-gaining-focus/5392/1 "2006-01-25T20:52:15Z")

</div>

Hello,

We have begun doing some development in Servoy and I have run across an issue that I need some help with.

I have a method that hides a tabpanel on a form. When I set the tabpanel visible to 0 a field on my form gains focus. I have gone through the debugger and can’t seem to find why this would be happening. Here is the case block this happens on:

case ‘Height’:  
databaseManager.startTransaction()  
forms.enter\_vitals.height = globals.g\_KeypadHoldField;  
globals.g\_KeypadHoldField = ‘’;  
forms.enter\_vitals.elements.list\_tab.visible = 0;  
databaseManager.commitTransaction()  
break;

So after this runs a field named temperature will have the cursor blinking in it until I click somewhere on the form.

I imagine its something simple that I have overlooked but any help would be appericated!

-Thanks  
Bryant

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [January 25, 2006, 9:48pm UTC](https://forum.servoy.com/t/field-gaining-focus/5392/2 "2006-01-25T21:48:34Z")

</div>

First of all, why are you doing that transaction? Seems like there is no reason to do it…

Second, have you set a tab sequence for the elements? Can it be that that’s the reason?

Do you do anything onRecordSelect or so? I don’t see any reason in your method why that field gets focus…

---

<div class="post-metadata">

**Author:** ![monetteboy](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@monetteboy](https://forum.servoy.com/u/monetteboy)\
**Post date:** [January 26, 2006, 4:59am UTC](https://forum.servoy.com/t/field-gaining-focus/5392/3 "2006-01-26T04:59:52Z")

</div>

Thanks for the reply.

As for the transaction…I placed that in there to see if it would help my problem, mainly just trying different things. I just hadn’t taken it out yet.

I did set the tab sequence and the field is number 3 I believe. I wondered if that would have been causing it but it didn’t seem to make a difference.

I don’t have anything for the onRecordSelect. I do have a method that runs with the onFocusGained and onFocusLost but I removed them and it didn’t make any difference.

Before I left work I deleted the field and then placed it back on the form. Now another field always gains focus.

Tomorrow I am going to dig deeper as I am sure I am overlooking something.

Thanks!

-Bryant
