W3C home > Mailing lists > Public > www-forms@w3.org > August 2006

Re: Can toggle@case or case@selected be calculated?

From: Mark Birbeck <mark.birbeck@x-port.net>
Date: Thu, 10 Aug 2006 17:17:00 +0100
Message-ID: <640dd5060608100917y7dc69da6ta99fb51aaa9702e2@mail.gmail.com>
To: "Kugelman, John" <jkugelman@progeny.net>
Cc: "Flinton Adam" <Adam.Flinton@cfh.nhs.uk>, www-forms@w3.org

Hi John,

> Has the working group ever considered allowing the active case to be
> calculated declaratively, like relevance?

Yes, I think it's even in a requirements document somewhere!

However, some of the things you describe can already be done. For example:

>     <switch select="concat('case-', x)">
>       <case id="case-1"/>
>       <case id="case-1"/>
>       <case id="case-1"/>
>     </switch>


  <group ref="x[text() = '1']">

  <group ref="x[text() = '2']">

etc. You don't need a bind statement to make this work.

I like this because you can spread the groups about, but if you do
want to keep them together to look more like switch/case, you could do

  <group ref="x">
    <group ref=".[text() = '1']">

    <group ref=".[text() = '2']">

Speaking only for myself, I don't have any problem with making this
kind of construct easier, but I think it would be better to achieve
this through some extra mechanisms, rather than changing switch/case.
By binding that to the model you introduce all sorts of quirky things
like what should happen if the user toggles a case that is bound to
the model--should the underlying data change?

At the moment switch/case is purely a UI construct, and although it
often *feels* like you need to bind it to the model, you'll actually
find that this usually indicates you don't need a switch/case.

That probably sounds a bit obtuse...what I'm getting at is that
switch/case currently operates via an action, rather than being bound
to data. The moment you mix the two, things start to get messy. I
would like to see switch/case kept as something that is action driven,
since that's very useful; but then we could also make it easier to
define 'relevance' sections without having the hassle of creating
extra instances. There are lots of ways that could be done, such as
improving lazy authoring, adding DI selectors, and so on.)



Mark Birbeck
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
Received on Thursday, 10 August 2006 16:17:16 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:18 UTC