W3C home > Mailing lists > Public > www-forms@w3.org > February 2007

Re: Event handlers defined in irrelevant form blocks

From: Mark Birbeck <mark.birbeck@x-port.net>
Date: Tue, 6 Feb 2007 19:06:19 +0000
Message-ID: <640dd5060702061106k1423f1b0yd648715311085b72@mail.gmail.com>
To: "Klotz, Leigh" <Leigh.Klotz@xerox.com>
Cc: Nick_Van_den_Bleeken@inventivedesigners.com, "Clark, John" <CLARKJ2@ccf.org>, www-forms@w3.org, www-forms-request@w3.org

Nick is right. This was intended to clarify whether relevance could be
implemented using something like "display: none;" in CSS (which leaves
the controls intact, but just hides them), or whether the non-relevant
nodes were in effect 'removed' from the document, and did not
participate in any way.

The two are very different, because if you attach to a control an
'xforms-value-changed' handler that simply adds 1 to a node, and then
ensure that the control becomes non-relevant, you will get different
results from the 'add 1' part, depending on how relevance is
implemented.

Anyway, the latter technique is much more efficient on very large
forms, and is particularly useful when implementing a server-based
XForms processor, where you can save bandwidth and processing time by
not delivering non-relevant controls to the UI.

Having said all of that... :) in John's original question the action
that was failing concerned a handler that was running in the context
of a node that was *deleted* in a prior processing stop in the same
handler. This meant that the second action failed because its
evaluation context had just been obliterated! The thread of discussion
is here:

  <http://www.formsplayer.com/node/698>

Regards,

Mark

On 06/02/07, Klotz, Leigh <Leigh.Klotz@xerox.com> wrote:
>
> Oops!
>
> -----Original Message-----
> From: Nick_Van_den_Bleeken@inventivedesigners.com
> [mailto:Nick_Van_den_Bleeken@inventivedesigners.com]
> Sent: Tuesday, February 06, 2007 12:00 AM
> To: Klotz, Leigh
> Cc: Clark, John; www-forms@w3.org; www-forms-request@w3.org
> Subject: RE: Event handlers defined in irrelevant form blocks
>
> All,
>
> Didn't this recently change by issuing erratum 31.2 Rigorously Define
> Non-relevant Form Control
> (http://www.w3.org/2006/03/REC-xforms-20060314-errata.html#E31b)? It
> explicitly states that "A critical part of this erratum is that XForms
> action handlers for events on the form control are disabled when the
> control is non-relevant" this the of course repeated in the 'Changed
> specification wording' section "When a form control becomes
> non-relevant,
> it must receive event xforms-disabled and then the XForms action
> handlers
> that are listening for events on the non-relevant form control must be
> disabled."  Or am I reading this incorrectly?
>
> Regards,
>
> Nick Van den Bleeken  -  Research & Development
> Inventive Designers
> Phone: +32 - 3 - 8210170
> Fax: +32 - 3 - 8210171
> Email: Nick_Van_den_Bleeken@inventivedesigners.com
>
> www-forms-request@w3.org wrote on 02/05/2007 07:00:37 PM:
>
> >
> > John,
> > No, relevance has no effect on action handlers.  Relevance does affect
> > submission and validation (modulo the submission/@relevant attribute).
> > There are also some events that are sent to in response to relevance
> or
> > instance node appearance/disappearance (xforms-enabled,
> xforms-disabled)
> > so you will see some effect there.  (Does anybody think differently
> > here?)
> >
> > Although it doesn't have to be the case, most XForms 1.0 integrations
> > with XHTML use relevance to control the :enable and :disabled CSS
> > properties.
> >
> > If you need to control actions, take a look at the new conditional
> > attributes on actions in XForms 1.1.
> > Leigh.
> >
> > -----Original Message-----
> > From: www-forms-request@w3.org [mailto:www-forms-request@w3.org] On
> > Behalf Of Clark, John
> > Sent: Monday, February 05, 2007 7:24 AM
> > To: www-forms@w3.org
> > Subject: Event handlers defined in irrelevant form blocks
> >
> >
> > If you define an event handler somewhere in a form element, and that
> > form element becomes irrelevant, does that disable (or in any other
> way
> > change) the event handler somehow?  Does it matter whether or not the
> > observer for the event handler is a descendant of the irrelevant form
> > element?
> >
> > Take care,
> >
> >     John L. Clark  |  Systems Analyst
> >                    |  Cardio-Thoracic Surgery Research
> >  Cleveland Clinic  |  9500 Euclid Ave.   |  Cleveland, OH 44195
> >                    |  (216) 445-6011
> >
> > ===================================
> >
>
>
> --------------------------------------------------
> Inventive Designers' Email Disclaimer:
> http://www.inventivedesigners.com/email-disclaimer
>
>
>


-- 
Mark Birbeck
CEO
x-port.net Ltd.

e: Mark.Birbeck@x-port.net
t: +44 (0) 20 7689 9232
w: http://www.formsPlayer.com/
b: http://internet-apps.blogspot.com/

Download our XForms processor from
http://www.formsPlayer.com/
Received on Tuesday, 6 February 2007 19:06:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:08 GMT