Alternating Portal Row Colors

It would be nice to be able to easly set the portal row colors and if they are alternating or not. All from the properties window, while in designer mode. Not just setting via a method.

This would speed up development when you know a portal is static and will never be changed.

If this is already there then I am sorry, because I didn’t find it.

Is already there. On the FORM level. Read the properties list - it’s at the bottom.

bcusick:
Is already there. On the FORM level. Read the properties list - it’s at the bottom.

Is it the “rowBGColorCalculation” property line?

If so how do I go about setting which portal to have alternating colors on the form?

You already have that information.

Open your Servoy help (F1) and select the Index tab and type the following:

Form, Adding background color to rows

Now browse to the bottom of your help screen and find a ready to use calculation.

create an unstored calc “myCalc”
and attach this to the “rowBGColorCalculation” property

var index    = arguments[0];
   var selected = arguments[1];
   if (selected) {
      return "#CBDEF9";
   }
   else {
      if (index % 2 == 0) {
        return "#FFFFFF";
      }
      else {
         return "#000000";
      }
   }

Using the calc mentioned above by Maarten.
The alternating row color is working OK the selected row gives strange results:

Setup :listview of table x
when I switch to designer everything is OK meaning alternating rows & record 1 is highlighted in the selected color.
When I click on a record background that record get’s the selected color
When I click on a field in a record the record is getting (I think ) the default color.

So to summarize: Everything works as expected until I click a field instead of a background.

Probably something simple but to difficult for me :oops:

Anyone

so when you click inside a field, the background of the record itself doesn’t change into “selectedRowColor” ?

I can’t reproduce this.
What happens if you activate the transparant property of the field?

transparancy was already activated

Version R2 2.1.2-build 315
Java version 1.4.2_03-b02 (Windows 2000)

On another point: why would a detail form based on the same table also take the colorcalc in consideration ?

Would it be possible to check your code with latest build?
I believe some fixes have been made for bgcoloring.

I tested on:
Version R2 2.2rc1-build 319
Java version 1.5.0_01-b08

Then it just will have to wait until 2.2 is production ready which won’t be to long anymore I imagine

THX