click-user mailing list archives

Hello all
I have updated the BooleanSelect field and added the StyledOption (&
removed StyledBooleanSelect)
samplepages:
clickclick-core-examples/controls/styledOption.htm
clickclick-core-examples/controls/booleanSelect.htm
cheers
Christopher
Changes:
[StyledOption]
- extracted StyledOption to normal class
- added id attribute (formName_selectName_optionName)
- removed all other styles and attributes
- you can format individual options with their id:
"option.optionId {...}" or,
- you can use the last part of the id to uniformely format
individual options of multiple Selects:
"option[id$=optionId] {...}". (see examplepage for what's possible)
- or you can set the id property to a custom id for easier css formatting.
[BooleanSelect]
- removed the customised set/getValue() set/getObjectValue() methods
to better reflect the way IntegerField and LongField work.
If you want typesafety use get/setBoolean().
- semantics of getBoolean are slightly changed in that null and "" are
null, "true" == True (ignoreCase) and everything else is False
(before, 'everything else' was null)
these semantics better follow how Boolean.valueOf converts String
values (except that valueOf never returns null, but we need this for
our Tristate)
- always uses StyledOption with names 'unset', 'true' & 'false', this
means the ids are 'formName_selectName_[unset/true/false]'
you can use (in css) option[id$=...] to enlarge the number of
options to which your style will be applied.
We could also just give them ids of just the name, then you would
need nesting to apply styles to a specific instance.
ex. setting all true values to green: 'option[id$=true] {color:
green;}' vs. 'option.true {color: green;}'
the first is easier to set individual instances, the second is
easier to set all instances.
[Other]
- removed StyledBooleanSelect
- I have not made a StyledOptionGroup class. You can already style
them at Selectlevel using elementname and nesting, it could be added
if the need were to arise though.
- split examplepages into one for BooleanSelect and one for
StyledOption, I may have gone a bit overboard with this last one...
:-)
- The Javascript is not as robust as before. By using Ids in Options
makes changing the styles with javascript a lot harder, as you have to
copy styles from the rules and not just from the element itself. This
makes getting the script right a lot harder (especially if there are
some inherited styles).
therefore I'm seeing the Javascript as an unsupported feature, which
you can copy from the samplepage if you like, but nothing more. It's
only for Firefox anyway.