I tried to make my first steps using CSS. I succeeded to get parts of my form designed the way I want it. My CSS is very simple:
- Code: Select all
form
{
border-style: solid;
border-width: 0px 0px 0px 0px;
background-color:#f0f0f0;
}
field
{
background-color:#FFFFFF;
border-style: solid;
border-width: 1px 0px 0px 1px;
border-color: #999999 #ffffff #ffffff #999999;
font-family: Arial;
font-size: 11pt;
color: #000000;
text-align: left;
margin: 0px 0px 0px 2px;
vertical-align: top;
font-weight: normal;
}
label
{
font-family: Arial;
font-weight: bold;
font-size: 11pt;
color: #000000;
text-align: left;
border-color: #ffffff;
border-style: solid;
border-width: 0px 0px 0px 0px;
}
So this looks very simple. But when I have comboboxes and they are readonly, then these comboboxes are getting some gray background. When I remove form.ReadOnly = false, then the combobox becomes like I want it. The combobox doesn't have a specific styleclass.
I looked at some other example Style files, where I see sometimes entries like:
- Code: Select all
field.readonly
{
background-color:#eeeeee;
color: #808080;
}
This assumes that when this field is readonly, that (back)ground color is changing, but that doesn't work in my case.
My questions:
1) Is there some default CSS-file which is used by default by Servoy where is defined that all items have a default CSS-setting if no specific setting is defined. If that is the case, where do I find this? Somewhere there must be a setting that says that readonly comboboxes must become gray.
2) Is there some way, where you can enter a default behavior for certain displaytypes (for example combobox, radios) without using a styleclass. Or is there some way where I can register that for displaytype 'Combobox' that the styleclass 'field.combobox' must be used without the need to register that for each combobox on each form.
3) Is there some way, where the CSS-setting changes in a certain situation, like on form readonly. Or was the example with field.readonly used in an application. Perhaps in readonly mode all fields on the form are dynamically attached to field.readonly and the moment that readonly becomes false, that all fields are resetted again to styleclass 'field'.
The Servoy documentation is not extended concerning this subject.
Hope someone can help me with this.
Thanks
Martin
Servoy Developer
Version 3.5.1-build 514
Java version 1.6.0_03-b05 (Windows XP)