W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2004

[whatwg] Interleaved repetition blocks

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 1 Jul 2004 12:38:23 +0000 (UTC)
Message-ID: <Pine.LNX.4.58.0407011226360.3456@dhalsim.dreamhost.com>
On Thu, 1 Jul 2004, Mark Schenk wrote:
> These questions still apply.
>| A major problem this brings is the numbering of the "index" value for
>| the repetition blocks. This would have to be dynamically updated to all
>| of the same repetition blocks.

It would be a pain, if the repetition template wasn't in the same place as
the repetition blocks. But then that that works at all is largely luck.
The repetition system was never designed to cope with repetition blocks
that aren't siblings of the template.

In the simple case, where the pre-defined templates use negative values as
their index, and the only way new templates are added is via "add"
buttons, there is no problem; the template automatically increases its
index to take care of this.

In cases where it would be a problem, the author can use the relevant DOM
methods that the spec provides to do it. Since this isn't supposed to be a
supported case anyway (I have yet to see a use case, in fact), I don't
think that is too much of a burden.

Remember, this is a way of repeating form controls, not a template system!

> > This leads me to another question: why don't the index values changes
> > when moving the repetition blocks up/down? That kind of defeats the
> > purpose of the auto-numbering of the name attributes, as the order in
> > the markup will differ from the index numbering.

The purpose of the numbering is to allow controls in different blocks to
be uniquely identified. It isn't for ordering. The controls are submitted
in the order the user leaves them in at the end, which should be enough
for the server to get the order. See the demo for how to get the order:


Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 1 July 2004 05:38:23 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:35 UTC