Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 46375 invoked from network); 12 Sep 2003 22:27:27 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 12 Sep 2003 22:27:27 -0000 Received: (qmail 30751 invoked by uid 500); 12 Sep 2003 22:27:08 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 30694 invoked by uid 500); 12 Sep 2003 22:27:08 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 30678 invoked from network); 12 Sep 2003 22:27:08 -0000 Received: from unknown (HELO pdx3.collegenet.com) (63.74.198.13) by daedalus.apache.org with SMTP; 12 Sep 2003 22:27:08 -0000 To: dev@cocoon.apache.org Subject: odd little Woody things MIME-Version: 1.0 Sensitivity: X-Mailer: Lotus Notes Release 6.0.1 February 07, 2003 Message-ID: From: mratliff@collegenet.com Date: Fri, 12 Sep 2003 15:27:12 -0700 X-MIMETrack: Serialize by Router on pdx3/UAI(Release 6.0.2CF1|June 9, 2003) at 09/12/2003 15:27:14, Serialize complete at 09/12/2003 15:27:14 Content-Type: multipart/alternative; boundary="=_alternative 007B57D088256D9F_=" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N This is a multipart message in MIME format. --=_alternative 007B57D088256D9F_= Content-Type: text/plain; charset="US-ASCII" 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: but this doesn't: (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 --=_alternative 007B57D088256D9F_= Content-Type: text/html; charset="US-ASCII"
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 &lt; 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 --=_alternative 007B57D088256D9F_=--