W3C home > Mailing lists > Public > www-forms@w3.org > January 2002

AW: recalculating several models

From: Roman Huditsch <roman.huditsch@hico.com>
Date: Mon, 7 Jan 2002 14:54:30 +0100
Message-ID: <0C79A363CB0321418927D0CB1AD0403C09594A@hicoetsrv000006.hico.local>
To: "Tomayko, Ryan" <Ryan_Tomayko@stercomm.com>, <www-forms@w3.org>
>Is this valid? 

As far as I know, the Syntax id('i2')/i:mom/i:daughter is indeed valid.

best regards,
Roman Huditsch

-----Ursprüngliche Nachricht-----
Von: Tomayko, Ryan [mailto:Ryan_Tomayko@stercomm.com]
Gesendet: Montag, 7. Januar 2002 14:48
An: www-forms@w3.org
Betreff: RE: recalculating several models


> id('i2')/i:mom/i:daughter

Is this valid? I was unaware of using the id function in this way to
retrieve a separate instance document. If this is not currently specified in
the draft I would propose adding it or something similar. This is very
useful.

- Ryan

-----Original Message-----
From: Jérôme Nègre [mailto:jerome.negre@e-xmlmedia.fr]
Sent: Monday, January 07, 2002 5:48 AM
To: www-forms@w3.org
Subject: recalculating several models


Hi,

In the current working draft, events xforms:recalculate and xform:revalidate
are dispatched to element model. This implies that recalculation and
revalidation are done a model after another (as described in chapter
11.3.6).

But, for some kind of dependencies, such as in the following example, this
is not possible:

<html xml:...="...">
 <head>

  <xform:model id="m1">
   <xform:instance id="i1">
    <i:dad>
     <i:son1>value</i:son1>
     <i:son2>value</i:son2>
    </i:dad>
   </xform:instance>
   <xform:bind ref="i:dad/i:son2" calculate="id('i2')/i:mom/i:daughter"/>
  </xform:model>

  <xform:model id="m2">
   <xform:instance id="i2">
    <i:mom>
     <i:daughter>value</i:daughter>
    </i:mom>
   </xform:instance>
   <xform:bind ref="i:mom/i:daughter" calculate="id('i1')/i:dad/i:son1"/>
  </xform:model>

 </head>
 <body>
  <xform:input model="m1" ref="i:dad/i:son1">
   <xform:caption>Change me</xform:caption>
  </xform:input>
 </body>
</html>

The recalculation must happen in the following order :
1/ The user changes the value of id('i1')/i:dad/i:soon1 via the input
control.
2/ id('i2')/i:mom/i:daughter is recalculated.
3/ id('i1')/i:dad/i:son2 is recalculated.

In order to have this behaviour, I think recalculation/revalidation should
be made global, and their corresponding events should be dispatched to
either the root element of the document, or to a new element containing all
the models.

Am I missing something ?

Regards,
Jérôme Nègre
Received on Monday, 7 January 2002 08:59:18 GMT

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