Sounds good, though perhaps accept could be clearer - it's really type-sensitive parsing... I can't think of anything better at the moment.
-----Original Message----- From: P T Withington <[EMAIL PROTECTED]> Sent: Friday, November 14, 2008 11:55 AM To: Max Carlson <[EMAIL PROTECTED]> Cc: J Crowley <[EMAIL PROTECTED]>; Platform Team <[EMAIL PROTECTED]>; Laszlo-dev bug reporting <[email protected]> Subject: Re: [Platform-team] lz.colors question But he should also be able to say: bgcolor="iceblue" and/or bgcolor="${this.acceptValue('iceblue', 'color')}" Which might be more instructive. In the first case, you are specifying a constant color, and since bgcolor is an attribute with a type of `color` the token `iceblue` is acceptable as a value (not tested). In the second case, you are using a constraint, and (at least as of now), constraints are simply expressions that _directly_ set the value of an attribute -- they _do_not_ pass through the data interface, which converts string representations into values according to type. (I think this is desirable.) So, in the second case, I am calling the (currently unpublished) `acceptValue` method, which takes a string representation of a value and parses it according to the specified type. There should be a better way. Perhaps I should be able to say: bgcolor="$accept{'iceblue'}" (meaning use acceptValue and the attribute's declared type to parse the value of the expression)? We've already got $path and $style, why not $accept (unless someone can come up with a better name). I think this would allow me to say something like: <inputtext id="color" /> <view bgcolor="$accept{color.text}" /> would that be useful? On 2008-11-13, at 21:16EST, Max Carlson wrote: > You should be able to just set it to bgcolor="lz.colors.iceblue4" - > constraints shouldn't be required. Also note that colors aren't in > global[] anymore - use lz.colors[''] instead. > > J Crowley wrote: >> So, I'm working on fixing one of the color dguide examples. The >> description on the doc page (docs/developers/color.html) reads: >> ----- >> To specify any color but the 16 which are usable by name, use >> 0xFFFFFF hex codes. Alternatively, the non-standard colors named in >> |lps/components/base/colors.lzx| were added to OpenLaszlo's global >> namespace. Those colors can also be employed by name, but note the $ >> {constraint} synta [The entire original message is not included]
