Dumb question about rowbgcolorcalculation

I have a field that calculates one of two color values. The field is returning the correct color code, but I can’t seem to get that color on the rows of my form.

The field is an unstored calc called servoy_row_bgcolor. I’ve tried it as Media and as Text:

if ( utils.stringPatternCount ( ‘\n’ + globals.Selections_New + ‘\n’, ‘\n’ + pk + ‘\n’ ))
{
return ‘#ffff33’ ;
}
else
{
return ‘#cccccc’ ;
}

The If condition checks whether the key of this record is in a global variable with a list of selections. Like I said, it accurately returnes #ffff33 or #cccccc, but the row doesn’t change colors when I select that field for the rowBGColorCalculation attribute.

I’ve seen this work. What the heck am I doing wrong here?

Hi Cain,

Starting in 2.1 - you can call the color calculation ANYTHING you want. Then you specify the name of the calculation on the FORM PROPERTY called “rowBGColorCalculation”.

:D

Hope this helps,

Bob Cusick

Bob, do you ever rest? :wink:

OK. I did that, but the rows on the form don’t change background colors. Just flat out nothing at all happens.

Have you set the “bgcolor” property of the body part to a color manually?

If so, then use the “DEFAULT” setting.

Bob

(No TIME to rest…) :D

Curiouser and curiouser…

All the layout parts are set to “default” for background color.

I just noticed that while the list, which clearly is using the unstored color calc for rowBGColorCalculation, isn’t changing color, the form IS changing color for the selected records! I don’t even have that property set on the form.

Major weirdness.

Just found that if I change the form to a list view, the coloration stops.

New theory… is it possible that Servoy can’t use Application globals on a row by row basis on a list?

No, the calc engine CAN use globals.

RULE: If you can “see it” when you’re creating the calc (in the object tree) - you can use it. If you CANNOT SEE IT - you can’t.

Bob

Cain,

Try:

if ( utils.stringPatternCount ( '\n' + globals.Selections_New + '\n', '\n' + pk + '\n' ) > 0)
{
return '#ffff33' ;
}
else
{
return '#cccccc' ;
}

See if that does it.

Bob

there was a bug that if you use default color in a listview then the row bg color wasn’t displayed (because everythign was transparant)
Is fixed in 2.1.1 final

The calculation is already returning the correct values.

Neither color is the default. I’ve changed them to bright green and bright pink.

It works on the form, but not on the list.

it is not the color the calculation is returning!
it is the color the body part (the listview itself) has!
Give the body part a color and you will see that the calculation works.

Aha! :)

Thanks for the clarification.

Say, is there someplace we can see a list of pending enhancements and bug fixes? I hate to waste time with stuff that’s already been discussed, but it seems like things of this nature are buried in multi-page threads here in the forum. Am I just looking in the wrong place?

with a release we do a sum of bugs fixed/ features implemented
in between we are reporting them in the forum where it got reported.
So do a quick search if you find something. If you don’t find anything simular then post it youre self.

There is currently not a list that is reporting the bugs that will be fixed in the comming release.