Unexpected onElementFocusGained

Hi Guys!

I have an issue with onElementFocusGained and I know how to fix it but cannot reproduce it in a sample solution.
There are two views in my solution, list and detail. They toggle when the user hits a button.
What happens is every second time the user toggles the view, onElementFocusGained is fired for the detail form and the source of the event is the first focusable field on that form.
I’m NOT calling elements.field.requestFocus() anywhere, the field is just the first one in the form tab sequence.
If I put a tabpanel as the first element in tab sequence - the issue is fixed. But it’s more of a workaround than a valid fix.

Because I am running some methods in onElementFocusGained() it is really inappropriate that it fires on its own but I cannot understand why it happens.

There’s more to it. To switch from list view to detail, we have two buttons: one is in the actual grid of records, a ‘view’ icon against each record, and the other one is in the action bar on top of the application.
If I use the button on top, everything is fine and onElementFocusGained() is idle.
But if I use my icon in the grid, then every second time ( :roll: ) the event goes on.
The icons in the grid and in the action bar execute the same function, there’s absolutely no difference in the code they’re running.

I’ve tried to replicate the issue in a sample solution but without much luck.
Any clues on what can be going wrong?

Thanks heaps!

Cheers,
Maria