cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "depub2" <dep...@mxsi.com>
Subject Re: CONTRIBUTION: repeater-widget (insert row): InsertRowsActionDefinition
Date Thu, 03 Feb 2005 19:21:10 GMT
> Sylvain wrote:

depub2 wrote:

>Hello Folks,
>
>I would like to make a small contribution to the cocoon repeater-widget
>(insert row) and would like someone (Sylvain Wallez?) to accept my code; so
>I'll be a "ghostwriter" as it does not make sense for me to maintain this
>small piece of code.
>
>Specifically, I would like to add something like:
>  package org.apache.cocoon.forms.formmodel;
>  public class InsertRowsActionDefinition extends RepeaterActionDefinition
>{}
>
>It will act like DeleteRowsActionDefinition; but instead will insert a
>single row in front of each of the selected rows. This sure seems like a
>natural need for the repeater! Yes?!?
>
>

Sorry, it doesn't seem natural to me, and I never saw such behaviour,
particularily inserting several rows at once and inserting them before
the selected row.

Now I understand that the set of available repeater-actions is currently
limited, and that "add-row" that inserts a new row at the end of the
repeater may not be the most convenient when you want to insert a row at
an arbitrary place in the repeater (although you have the "add-after"
row-action).

So IMO the behaviour of an "add-rows" action should be to add rows
_after_ the selected rows. This kind of interaction usually involves a
single selection, but we could find it acceptable that it is generalized
to inserting a row after all selected rows.

What do people think?

Sylvain


> Hi Sylvain,
> As you mention it, I think "add-rows" would be as-good or better than
"insert-rows".
> Since the change is fairly trivial to the tested "insert-rows" code you
> now have from me, it might even be worthwhile to have both "insert-rows"
and
> "add-rows" and allow the user / GUI designer to select their choice.
> Perhaps the repeater samples code could be modified to only demonstrate
> "add-rows" to "steer" a GUI designer in that more favorable direction.
>
> One nice side-effect of multiple-checked insert-rows/add-rows capability
is
> that multiple-selection enables one to rapidly insert multiple rows
through
> exponentially increasing iterations of inserts. (check 1, check 2, check
4,
> check 8...) Just to clarify, "my code's" behavior is that a _single_ row
is
> inserted above (below is fine too) every selected row. Adding 32 new/blank
> rows is simply a 5x "add-rows" operation. Perhaps it would be helpful to
> "pre-select" the rows that were added so that this multiple exponential
> insert is even easier on the user, so they don't have to check the boxes.
> Woe unto them that later perform "delete-rows" without deselecting first.
>
> As it turns out, multiple-select insertion was easier to implement than
> single-selection, based on copying the delete-rows code and minor tweak.
>
> If you find it difficult to modify the samples code, I could probably
> do it and email it to you.
> Best, David Epperly -depub2


--
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }





Mime
View raw message