W3C home > Mailing lists > Public > www-forms@w3.org > April 2004

RE: XForms Actions

From: Mark Birbeck <mark.birbeck@x-port.net>
Date: Thu, 22 Apr 2004 22:53:59 +0100
To: <bobbateman@sequoiallc.com>, "'Roland Merrick'" <roland_merrick@uk.ibm.com>, "T. V. Raman" <tvraman@us.ibm.com>
Cc: <www-forms@w3.org>
Message-ID: <001601c428b4$53403e40$0a01a8c0@W100>

Hello Robert, Roland and Raman ...

DOMActivate would be no good because it would occur prior to the user's
changes.

The following should work:

  <xf:instance>
    <data>
      <field1 />
      <field2 />
    </data>
  </xf:instance>

  <xf:input ref="field1">
    <xf:label />
    <xf:setvalue
     ev:event="xforms-value-changed"
     ref="field2"
     value="../field1"
    />
  </xf:input>

  <xf:input ref="field2">
    <xf:label />
  </xf:input>


Note that in xf:setvalue, the @value XPath is relative to the XPath in @ref
- which may be where you are having problems. This is not clear in the spec,
and is the subject of a forthcoming errata.

Regards,

Mark


Mark Birbeck
CEO and CTO
x-port.net Ltd.
 
Download our XForms processor from
http://www.formsPlayer.com/
 
-----Original Message-----
From: www-forms-request@w3.org [mailto:www-forms-request@w3.org] On Behalf
Of Roland Merrick
Sent: 22 April 2004 13:58
To: bobbateman@sequoiallc.com
Cc: www-forms@w3.org
Subject: Fw: XForms Actions



Greetings, xforms-activate was replaced by DOMActivate, but
xforms-value-changed should work as well for the scenario you describe. 

Regards, Roland 
----- Forwarded by Roland Merrick/UK/IBM on 22/04/2004 13:54 ----- 
"T. V. Raman" <tvraman@us.ibm.com> 
Sent by: www-forms-request@w3.org 
20/04/2004 15:08 Please respond to
tvraman

Tobobbateman@sequoiallc.com 
ccwww-forms@w3.org 
SubjectXForms Actions









actually I'd hook event xforms-activate for this use case ---

>>>>> "Robert" == Robert Bateman <bobbateman@sequoiallc.com> writes:
   Robert> So far, I've been only played with XForms action
   Robert> within <select1> code.  My code looks for an
   Robert> xforms-value-changed event and takes some action.
   Robert> 
   Robert> Now I would like to do something similar but with an
   Robert> <input> field.  My goal is to have the value of my
   Robert> input copied to another field once the
   Robert> xforms-value-changed event fires.
   Robert> 
   Robert> For example: I have 2 fields "field1" and "field2".
   Robert> Both contain peoples names.  On my form, an order
   Robert> form, I have to consider that field2 is editable if
   Robert> the user takes a specific path thru the form.  Both
   Robert> field1 and field2 are required to exist and can not
   Robert> be nill.
   Robert> 
   Robert> My thought was to add an event to field1 that traps
   Robert> xforms-value-changed and do a <setvalue> of field2.
   Robert> I also would add a group around field2 controlling
   Robert> when its <input> is active to the user.
   Robert> 
   Robert> All's well in my thoughts.  Unfortunately, I don't
   Robert> seem to be able to use an <action> inside of my
   Robert> <input> for field1.  Has anyone accomplished this
   Robert> sort of data copying using actions inside of inputs?
   Robert> 
   Robert> Thanks!
   Robert> 
   Robert> Bob

-- 
Best Regards,
--raman
------------------------------------------------------------
T. V. Raman:  PhD (Cornell University)
IBM Research: Human Language Technologies
Architect:    Conversational And Multimodal WWW Standards
Phone:        1 (408) 927 2608   T-Line 457-2608
Fax:        1 (408) 927 3012     Cell: 1 650 799 5724
Email:        tvraman@us.ibm.com
WWW:      http://almaden.ibm.com/u/tvraman
AIM:      TVRaman
GPG:          http://www.almaden.ibm.com/cs/people/tvraman/raman-almaden.asc
Snail:        IBM Almaden Research Center,
             650 Harry Road
             San Jose 95120
Received on Thursday, 22 April 2004 17:55:23 GMT

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