Styles & selected row

I have a table view with fields with the following style assigned. When a field is selected the text gets cleared as per attached.

How do I get this to hi light correctly.

field.row
{
	background-color: #ffffff; 
	border-style: solid; 
	font: 12pt "Arial"; 
	text-align: left; 
	margin: 20px 2px 1px 1px; 
}

[attachment=0]hi-lighted.png[/attachment]

The easiest way to do this is using the rowBGColorCalc property, see this topic for more info.

I have taken your advise but I am getting the save result. Thanks.

function row_bgcolour()
{
var index = arguments[0]
var selected = arguments[1]
if(selected)
{
   return '#ffff80'
}
else
{
   if(index % 2 == 0)
   {
      return '#ebebeb'
   }
   else
   {
      return '#ffffff'
   }
}
}

Hi James,

are you saying the fieldcontent is actually disappearing?
I think when Joas read your previous post, he understood the field was getting a white coloured background instead of the yellow background like the remainder of the row.

Your problem doesn’t ring a bell right away, I think it’s more like a property of the field.
Do you have any methods attached, like onFocusGained? Does this happen on all fields, or just this one?

When I select the field the text content disappears. It happens on all table view fields. There are no methods run on the form apart from the button at the start of the row.

Field properties are all standard apart from the style sheet setting.

That behaviour is quite weird. :)

Is it just a visual thing, so you can’t see the content anymore when selected? Or does your data really disappear from the database?
What version of Servoy are you using?
Do you see the same behaviour if you create a new table view with some fields but without anything else?

Found the problem. ```
margin: 20px 2px 1px 1px; should be margin: 0px 2px 1px 1px;


Staring me right in the face.

Thx