I've found some odd little things about Woody that may be features or bugs. Not sure which.
1) asserts only seem to work for equalities. This works:
<wd:assert test="Quantity1=Quantity2" />
but this doesn't:
<wd:assert test="Quanty1 < 3" />
(OT: I wonder what happens when you try to assert the equality of two widgets of different base types, e.g., long and string?)
2) setting model properties using model.foo=bar from flowscript doesn't work for all datatypes. This works:
model.account=2 (datatype is long)
but this doesn't:
model.account=2.03 (datatype is decimal)
Instead you have to use this:
model.account=new Packages.java.math.BigDecimal(2.03)
which is at least inconsistent with how other model properties are set.
Looks like request strings get automatically converted to the correct datatypes when readFromRequest() in Field object calls convertFromString() in FieldDefinition object. But setting model property programatically just calls setValue() in Field object, which does no conversion. Maybe setValue() should call some kind of convert method that handles known _javascript_ datatypes? Sorry, I don't understand Woody well enough to offer a more concrete suggestion.
3) wd:combine _expression_ used in aggregate fields is executed even when there are no data values for the "groups" being aggregated. So if you "blank out" (delete all characters) from the phone number in the form1 example the field displays "+--". Shouldn't aggregate field remain blank when the user blanks it out?
4) apostrophes (single quote) used in fail messages cause _javascript_ error. This is because the alert statement uses a single quote:
alert('foo')
and browsers _javascript_ sees apostrophe as premature truncation of alert string. I think it would be better to write alerts using double quotes
alert("foo")
because using single quote as apostrophe is much more common than using double quotes in strings. Most conjunctions on web pages (don't, can't, etc) use single quote.
Hope this is helpful.
Cheers,
--Michael
- Re: odd little Woody things mratliff
- Re: odd little Woody things mratliff
