- From: Mark Birbeck <mark.birbeck@x-port.net>
- Date: Mon, 30 Oct 2006 13:57:36 +0100
- To: "Paul Hermans" <paul.hermans@amplexor.com>
- Cc: www-forms@w3.org
Paul, To recap--John suggested that you need to use model-based switching with 'group', and you said that this may not be possible because you only have one element to bind to. Your question is essentially, how do I have many groups acting like a switch, with only one element to connect to? The answer has been presented on this list a few times, so you can do a search for more detailed examples--I'll just give you the high level view. The first person I saw using this technique was David Landwehr, and I think it originates from the fact that he lives, breathes and sleeps XPath. He suggests that you make use of filters, as follows: <xf:group ref="unit[@dimension='height']"> ... </xf:group> <xf:group ref="unit[@dimension='weight']"> ... </xf:group> Cunning, hey? Along with using entries on this list as a source of examples, look at an entry on Erik's blog on this subject. Regards, Mark On 30/10/06, Paul Hermans <paul.hermans@amplexor.com> wrote: > > > >The proper feature appears in the next working draft of XForms 1.1 (due > >out real soon now). > > Look forward to it. > > >For existing XForms 1.0 implementations, you need to change to using > >model-based switching based on the relevance of a set of groups. > > >For each case in your switch, use a group instead. Put all those groups > >into a single outer group. > > >For each inner group, express a ref to a node. Make that node be relevant > >if and only if the proper dimension selection is made. > > In this case I suppose that all groups (cases) need to 'bind' to different xml elements, > which isn't the case for me. > > I have one element "unit". > Depending on the choice made for dimension, I need to offer different pick lists of values. > If dimension 'length': meter, kilometer, ... > if dimension 'weight': gram, kilogram, ... > > Or am I missing something? > > Paul > > > -- 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 Monday, 30 October 2006 12:57:50 UTC