click-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Schellink <>
Subject Re: [clickclick] new BooleanSelect field
Date Sun, 19 Oct 2008 19:45:36 GMT
Hi Christopher,

BooleanSelect looks good.

I also don't think tweaking the control after onInit will be common. 
However if you want to support this a custom Option with mutable Label 
could do the trick.

One thing you might want to consider for the StyledBooleanSelect is to 
   "hardcode" the option CSS classes with no option of changing it. 
This way you can document the available CSS classes and force users to 
use external CSS to style it if they want. (its a shame browser 
support are so flaky with Option styling)

If you do consider this you might want to merge BooleanSelect and 
StyledBooleanSelect into one control where BooleanSelect has a 
StyledOption which appends the CSS classes.

Lastly you could probably remove the isMultiple logic in 
StyledOption#render as BooleanSelect does not allow multiple selection.

kind regards


Christopher Highway wrote:
> Hi all,
> Added the BooleanSelect (core) and experimental StyledBooleanSelect
> (examples) to the clickclick repository.
> I had a bit of a struggle with Click, but I came out on top in the end
> (I think...) :-)
> There is a testpage: clickclick-core-examples/controls/booleanSelect.htm
> I didn't put it in the menu or anything so you'll have to browse to it manually.
> [BooleanSelect]
> - there are get/setBoolean() methods in keeping with
> Integer/Long/Date/etc Fields.
> - added some default notations backed by the resource bundle (see sample page).
> - the required option defaults to tristate, not required defaults to
> twostate (read the class javadoc for more info).
> As OptionNames are final, and if the tristate property is changed 2 or
> 3 Options may be needed. For this the creation of the Options is
> deferred to onInit(), this means:
> a) the Options are not available for tweaking in page.onInit() (but
> Options don't have anything to tweak so that's only a minor issue)
> b) changes made after page.onInit() won't be reflected in the final result.
> [StyledBooleanSelect]
> The StyledBooleanSelect is a bit of a mixed success, it has some issues:
> java-side:
> Option does not have style attribute or class properties so I made a
> new StyledOption class to add them.
> the values are also buffered in the Select class as the options are
> only instantiated at control.onInit() so the same goes as for a) and
> b).
> html-side:
> Limited support for styling option elements (background-color and font
> are ok, but Images are only supported by Firefox)
> - if you use images you need to enable javascript to make it work correcty.
> - use of images regresses ok in IE but less in Opera.
> - colors work correctly in Opera and IE, but only show in the
> dropdownlist in Firefox (Opera and IE apply the style of the selected
> option to the Select control, but Firefox doesn't, this is also why
> the image has to be manually changed through javascript).
> Anyways, please have a look.
> Cheers
> Christopher
> PS: I put the two icons in assets/images folder.
> I made them myself, so there shouldn't be any copyright issues (used:
> Artweaver + Windows Webdings font)

View raw message