Tabbing not working with rowBGColorCalculation

Hello,
I am having a problems tabbing through fields in portals and table views if using the following rowBGColorCalculation.

var index = arguments[0];
var selected = arguments[1];
if (selected)
{
return '#9cd6ac';
}
else
{
if (index % 2 == 0)//alternate even/odd
{
return '#ffffff';
}
else
{
return '#f2f1f1';
}
}

Is this normal behaviour ?

I wouldn’t say so. And you say that once you remove that calc everything is fine?

Hi Patrick,

Yes if I remove the calc all is good.

What do you mean when you say that you have a problem? Does your cursor stay in the same field when you press tab?

Your calc seems to be correct to me.

Hello,
I’m sorry guys, :oops:
tabbing is working I just cannot see the cursor when the calc is applied, maybe I need more caffeine.

What would be the best method of high lighting the selected field ??

Hello,
I am trying to use a global method to set background field colours through the
onFocusGained, onFocusLost event. I am getting arguments OK from form, but I am unsure how to pass these arguments to my global method.

Global Method

var formName = arguments[0]; 
var elementName = arguments[1];

formName.elements.elementName.bgcolor = '#b5d2ee'

Form Method

var elementName = application.getMethodTriggerElementName();
var formName = application.getMethodTriggerFormName();
globals.setFieldFocusGained(formName,elementName);