[whatwg] WF2 part 1-3

On Wed, 25 Aug 2004, Mark Schenk wrote:
> 
> The current complexity is partly caused by the ability to have different 
> repetition blocks interleave, which I still believe is necessary, even 
> for a simple repetition model.

I agree. I've seen several forms (mostly on intranets or confidentially 
shown to me, sadly) that involve a few different repeating sections that 
can be arbitrarily reordered.


> In my (failed) attempts to formulate changes for the current 
> repeat-model, I got stuck because I'm not sure what the scope of the 
> repeat-model in WF2 should be. As you already mentioned in another post 
> [1]:
> 
> ".. the repetition stiff [sic] in WF2 was never meant to be a generic 
> repetition system. It's meant specifically for repeating form sections 
> in HTML."
> 
> That's exactly what is troubling me. The repetition stuff in WF2 is too 
> limited for a generic repetition system, but it is also feels quite 
> verbose and complex for the simple stuff, as pointed out by Hakon. I 
> haven't been able to put my finger on a good solution though. :(

Yeah, me neither.


> > > I don't like the name of the repeat-* attributes. I suggest these 
> > > names instead:
> > > 
> > >    <tr index="1">
> > >    <tr id="order" repeat="3">
> > > 
> > > The "repeat" attribute indicates that the element is a template.
> > 
> > Interesting idea.
> 
> I think it is even more confusing... the existing proposal may be very 
> verbose, it is very clear what the different attributes mean. Now you 
> remove the repeat-start attribute, but add a new index attribute. Where 
> is the improvement?

Good point.


> Another problem with the existing proposals is the fact that you will
> encounter elements with the same index/repeat value, when you use different
> repeat templates. Example:
> 
> <tr repeat="0" repeat-template="two_rows">
> <td>First row</td>
> <td>Second row</td>
> </tr>
> <tr repeat="0" repeat-template="one_row">
> <td>First row</td>
> </tr>
> <!-- here start the templates -->
> <tr id="two_rows" repeat="template" repeat-start="0">
> <td>First row</td>
> <td>Second row</td>
> </tr>
> <tr id="one_row" repeat="template" repeat-start="0">
> <td>First row</td>
> </tr>

True, but that shouldn't be a huge problem since the form controls in 
those different sections can be uniquely named.

For example, every time you use the index in the two row version, you 
could prepend "2r" to the ID:

   name="something.2r[two_row]"

...so then your form controls would be:

   something.2r0
   something.1r0

...etc.


> why not introduce the following:
> 
> <tr repeat="two_rows 0">
> <td>First row</td>
> <td>Second row</td>
> </tr>
> <tr repeat="one_row 0">
> <td>First row</td>
> </tr>
> <!-- here start the templates -->
> <tr id="two_rows" repeat-start="0">
> <td>First row</td>
> <td>Second row</td>
> </tr>
> <tr id="one_row" repeat-start="0">
> <td>First row</td>
> </tr>
> 
> That would kill the repeat-template attribute because you merge it into 
> one attribute on the repetition block

At the cost of much more complicated processing of the attribute, sadly, 
and without really simplifying the model at all.


> and it would give you unique values for "repeat" attributes throughout 
> the document:
> 
> repeat="[repetition template id] [repetition block index]"

Why is that an advantage, particularly?


> It could also remove the need for a "repeat" attribute on a repetition 
> template: the repeat-start would be sufficient to recognize it as a 
> repetition template.

Same problem. Actually the spec had something like this originally. It was 
more of a pain than a help, which is why I split them into multiple 
attributes. (You can see evidence of this in some of the examples -- they 
use the old syntax with comments saying these are invalid, or something.)


> > I also like the fact that "repeat" being used for both templates and
> > repetition blocks means you can't have an element that is both:
> > 
> >    <tr index="1" repeat="1">
> 
> Would this be valid/possible anyway?

I don't really want to even think about it. :-P

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Saturday, 28 August 2004 08:46:49 UTC