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

toggle/case

From: Mark Seaborne <m_seaborne@mac.com>
Date: Mon, 29 May 2006 18:58:55 +0100
Message-Id: <9CC45A3C-DC08-4D03-BC98-96DA26708F20@mac.com>
To: www-forms <www-forms@w3.org>

Hi,

I'm sure this must have been discussed before (I did look but  
couldn't see anything obvious), but here I go anyway.

I have got a switch/case construct:

<switch>
	<case id="a"/>
	<case id="b"/>
	<case id="c"/>
<switch>

, and all I want to do is let the user move along the sequence of  
cases in document order, a, b, c, or c, b, a. No exceptions.

So, I would really like just a single toggle action that navigates up  
the cases (a, b, c) and another that navigates down the way. Then I  
would only need two triggers to navigate through the  switch.

However, XForms 1.0 says that the case attribute on toggle is just "a  
reference to a case element", so I end up with loads of triggers.

If I have missed something obvious, and this is already possible,  
then please someone tell me. If not, has anyone implemented anything  
that makes this easy (or even possible), like allowing @case to take  
an XPath that evaluates to the name of a case, for example?

I can see that it would be possible to achieve the effect I want in  
XForms 1.1 (thanks for the hint Nick), but even there it is far from  
elegant. It seems such an obvious, simple thing to want to achieve  
that it should be made as easy as something like:

<xforms:trigger>
	<xforms:label>Next</xforms:label>
	<xforms:next switch="mySwitch" ev:event="DOMActivate"/>
</xforms:trigger>

<xforms:trigger>
	<xforms:label>Previous</xforms:label>
	<xforms:previous switch="mySwitch" ev:event="DOMActivate"/>
</xforms:trigger>

and let the XForms processor worry about remembering which case is  
current, and is it the first or last one. It must be easier than  
managing repeat.

And another thing, why should I have to write out  
ev:event="DOMActivate" everytime I use a trigger? Isn't it obvious?

All the best

Mark
Received on Monday, 29 May 2006 17:59:10 GMT

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