Field Gaining Focus

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

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…

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