W3C home > Mailing lists > Public > public-appformats@w3.org > September 2006

Re: A forms-lite straw man

From: Henri Sivonen <hsivonen@iki.fi>
Date: Tue, 5 Sep 2006 23:08:38 +0300
Message-Id: <79E2C290-E3AE-43F5-B99B-BA1849CC81D6@iki.fi>
Cc: Lachlan Hunt <lachlan.hunt@lachy.id.au>, www-forms@w3.org, public-appformats@w3.org
To: Dave Raggett <dsr@w3.org>

On Sep 5, 2006, at 19:33, Dave Raggett wrote:

> On Wed, 6 Sep 2006, Lachlan Hunt wrote:
> Another key difference is that in WebForms 2.0 the data is owned by  
> the field, thus a field can state which forms it belongs to. It is  
> better software engineering for the field to act as a view onto the  
> data. Decoupling the view and the data makes it easier to support  
> structured data and to describe calculations for derived fields and  
> other purposes.

It is possible and even convenient to use JavaScript closures  
attached to the DOM nodes of form fields for binding the form fields  
with an XHR-load/saved data model document tree. Such an arrangement  
has the benefit that it is backwards-compatible with existing Web  
browsers (including IE6).

> If the expression evaluates to false, the field is considered to
> be invalid. I got the name wrong and it should have been called
> validate. The expression could act over just the field's value,
> but it could also refer to the values of other fields. It could
> even call out to a function defined as part of a web page script.

What is the advantage over calling a JavaScript function from the  
onchange handler?

> WF2 essentially limits to boolean literals, and you cannot describe  
> the conditions under which a field is required. For example, your  
> parent's name might be required if your age is under 15.

The onchange handler of the age field can invoke a JavaScript  
function that toggles the required attribute on the name of parent  

>> The WF2 output element uses a JavaScript expression to evaluate
>> to a string.  What benefit does an XPath expression provide
> It is more declarative than calling out to a JavaScript function.

Why is that a benefit?

Henri Sivonen
Received on Tuesday, 5 September 2006 20:09:01 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:50:05 UTC