I need to set the background color of my form in a script.
But I haven’t found any possibility for that.
Perhaps I missed something.
Styles are not an option, because the color value will be in the database.
For RecordView forms I can put a label on the form, lying behind all other elements and that will make a background color for RecordView
But now I need the same for TableView. And for that I haven’t found a solution. Anyone has an idea?
So I need something like this:
forms.myForm.bgcolor = myDatabaseValue
or
forms.myForm.controller.bgcolor = myDatabaseValue
or
forms.myForm.part.body.bgcolor = myDatabaseValue
or
application.setFormProperty('myForm', 'bgcolor', myDatabaseValue)
I agree it’s somewhat of a hack but rowBgCalc should do the trick nicely. I would probably throw your db color value into a global to reference from the calc. And if you have a title header part and or footer part you can use the same label trick you use for record view to change its “background” color.
Optimally, it would be better if we could change more properties of more objects at runtime. Form background and various object borders are long time holdouts. That, and being able to modify properties on the fly by changing what style class they refer to instead of having to punch in the property values specifically. Right now we have to query the repository directly to grab style sheet data to use for our runtime object manipulation (such as custom tab controllers).
I’m pretty sure both of these things have been on the list for a while so hopefully once Servoy 4 makes it out the door…