W3C home > Mailing lists > Public > www-forms@w3.org > December 2003

Re: xforms for inhomogenous collections

From: Oliver Scholz <alkibiades@gmx.de>
Date: Wed, 17 Dec 2003 18:59:56 +0100
To: <www-forms@w3.org>
Cc: "Borgrink, Susan" <sborgrink@progeny.net>
Message-ID: <u4qvz9vfn.fsf@ID-87814.user.dfncis.de>

"Borgrink, Susan" <sborgrink@progeny.net> writes:

> Oliver, 
> 	
> 	In response to your first question, you should be able to
> 	achieve what you are thinking by using the group element with
> 	relevance. It would be very similar to the idea you had with
> 	the switch, but it would be based on the "XPath predicate".

Thank you, Susan. I have not thought of the group element. Though I do
not yet understand how exactly I should solve this first point. I do
not yet understand the standard in every detail. The way I see it,
"relevance" in the context of the group element refers to the
"relevant" attribute of a bind element in the model. Is that correct?
If so, I do not yet understand how I (as a user of my application)
could specify a bind element that would lead to the desired
effect. Could you give me a hint?

I guess, the simplest thing for my purpose would be something like the
following (with the example data in my last message). But as far as I
can see, this would be an extension.  Is that what you suggest?

    <xforms:repeat ref="/record-set/record">
      <hr/>

      <xforms:group relevant="@type = 'author'">
	<h2>An Author</h2>
	<xforms:input ref="name">
	  <xforms:label>Author Name</xforms:label>
	</xforms:input>
      </xforms:group>

      <xforms:group relevant="@type = 'book'">
	<h2>A Book</h2>
	<xforms:input ref="title">
	  <xforms:label>Book Title</xforms:label>
	</xforms:input>
      </xforms:group>

    </xforms:repeat>

> 	In response to your second question, the repeat element has an
> 	attribute called "number" that tells the processor how many of
> 	the collections to display at a time. [...]
> 	How you choose to design it, is up to you.

Thank you. This "number" attribute is exactly what I was looking for.


    Oliver
-- 
27 Frimaire an 212 de la Révolution
Liberté, Egalité, Fraternité!
Received on Wednesday, 17 December 2003 13:00:16 GMT

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