Headercolor with onRender

While converting our main solution to version six (Servoy 6.0.4) I bumped into this:
We have a form in Table View (locked) with a Header portion. On this part a label is placed with a special backround color and some labels with custom texts.
However, with the new onRender function this color is overuled by the isRecordSelected() color.
The LABEL element is detected as a record but the data that belong to it come from the selected record (This goes for ALL labels on the form.) So when the functions asks for the event.isRecordSelected() it will be true while the event element is a label. Unfortunately I can not extract this property from the JSRenderEvent object to correct the output of the function.
Anyone knows a solution for this?
Is this a bug?

Hi Jos.

Do not use the onRender() event of the form but the onRender() event in each field you want to change the color, of course pointing to the same function.

That works for me.

Rendering each individual field is (in this case) too complicated. I just want bgcoloring for a whole record. What I do now is call the getRenderable() function that returns the object to render. From this I can ask for the getElementType() or/and getName (I have to ‘name’ some elements explicitly).
By doing so I can check if the object is the right element to render in the right color.

please create a case for this in our support system http://www.servoy.com/s

Thanks for filing a support case, but we cannot alter this behaviour.
The selected record is always used outside the body part as datasource for any element, so we cannot start saying the record is not selected during onRender for elements in a not body part.