You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Gerry Kaplan <gk...@kaplansoftware.com> on 2005/09/23 04:06:17 UTC

Minimum number of rows for repeater

Is there a simple way of specifying the minimum number of rows for a
repeater. I have a repeater that requires that at least one row exist.

Currently, I specify that the default number of rows = "1", which works
great. But it doesn't prevent the user from deleting that row.

Gerry

Re: Minimum number of rows for repeater

Posted by Thomas Lutz <ma...@gmx.at>.
Thomas Lutz wrote:

> Jorg Heymans wrote:
>
>> <snip />
>>
>> http://issues.apache.org/bugzilla/show_bug.cgi?id=36781 to start.
>>
>>
>> If someone could add the Validation stuff that'ld be great, otherwise
>> i'll have a look at this myself later.
>>
>>  
>>
> I'll give it a try next week...

should be working :-), I added another patch containing the validation 
stuff...

:-),
tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Minimum number of rows for repeater

Posted by Thomas Lutz <ma...@gmx.at>.
Jorg Heymans wrote:

> <snip />
>
>http://issues.apache.org/bugzilla/show_bug.cgi?id=36781 to start.
>
>
>If someone could add the Validation stuff that'ld be great, otherwise
>i'll have a look at this myself later.
>
>  
>
I'll give it a try next week...

regards,
tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Minimum number of rows for repeater

Posted by Jorg Heymans <jh...@domek.be>.
Jorg Heymans wrote:
> 
> Cool! Let me dig up the patch and we'll take it from there.
> 

http://issues.apache.org/bugzilla/show_bug.cgi?id=36781 to start.


If someone could add the Validation stuff that'ld be great, otherwise
i'll have a look at this myself later.


Regards
Jorg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Minimum number of rows for repeater

Posted by Jorg Heymans <jh...@domek.be>.
Thomas Lutz wrote:

> +1 for doing this. I implemented this in my validation layer, which
> returns error messages for wrong cardinality. This prevents the user
> from submitting "wrong" data, but is rather a temp hack, as it would be
> a much nicer GUI if the add or remove buttons of the repeater
> disappeared...

this is easily accomplished if you use the jxmacros.

> Why do you think binding could be a problem ? I would say, let in
> everything that comes a long, if it's not enough or too much, display a
> validation-error.
> 
that's a good stop-gap solution yes, and probably the only one that
makes sense.

> I am not an expert in CForms sources, nor a java guru, but if you need
> help I could have a look at it... it's on my todo in the next 4 weeks...

Cool! Let me dig up the patch and we'll take it from there.


Thanks,
Jorg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Minimum number of rows for repeater

Posted by Jeroen Reijn <j....@hippo.nl>.
+1 for that!

I've hacked around it as well with a jx template showing the remove button or 
not. It would be great if we could implement the min and max attribute.

Jeroen

Thomas Lutz wrote:
> Jorg Heymans wrote:
> 
>> <snip />
>>
>> A few weeks ago I had the same need/idea, and hacked together a max-size
>> and min-size attribute for the repeater widget. If you want i can put it
>> in bugzilla so you can see if it helps your usecase.
>>
>> If this is useful for other people as well we should nail down the
>> behaviour and have a go at implementing this properly. Note that things
>> might get a bit more complicated when you take binding into 
>> consideration.
>>  
>>
> +1 for doing this. I implemented this in my validation layer, which 
> returns error messages for wrong cardinality. This prevents the user 
> from submitting "wrong" data, but is rather a temp hack, as it would be 
> a much nicer GUI if the add or remove buttons of the repeater 
> disappeared...
> 
> Why do you think binding could be a problem ? I would say, let in 
> everything that comes a long, if it's not enough or too much, display a 
> validation-error.
> 
> I am not an expert in CForms sources, nor a java guru, but if you need 
> help I could have a look at it... it's on my todo in the next 4 weeks...
> 
> regards,
> tom
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Minimum number of rows for repeater

Posted by Thomas Lutz <ma...@gmx.at>.
Jorg Heymans wrote:

> <snip />
>
>A few weeks ago I had the same need/idea, and hacked together a max-size
>and min-size attribute for the repeater widget. If you want i can put it
>in bugzilla so you can see if it helps your usecase.
>
>If this is useful for other people as well we should nail down the
>behaviour and have a go at implementing this properly. Note that things
>might get a bit more complicated when you take binding into consideration.
>  
>
+1 for doing this. I implemented this in my validation layer, which 
returns error messages for wrong cardinality. This prevents the user 
from submitting "wrong" data, but is rather a temp hack, as it would be 
a much nicer GUI if the add or remove buttons of the repeater disappeared...

Why do you think binding could be a problem ? I would say, let in 
everything that comes a long, if it's not enough or too much, display a 
validation-error.

I am not an expert in CForms sources, nor a java guru, but if you need 
help I could have a look at it... it's on my todo in the next 4 weeks...

regards,
tom


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Minimum number of rows for repeater

Posted by Jorg Heymans <jh...@domek.be>.
Gerry Kaplan wrote:
> Is there a simple way of specifying the minimum number of rows for a
> repeater. I have a repeater that requires that at least one row exist.
> 
> Currently, I specify that the default number of rows = "1", which works
> great. But it doesn't prevent the user from deleting that row.
> 

A few weeks ago I had the same need/idea, and hacked together a max-size
and min-size attribute for the repeater widget. If you want i can put it
in bugzilla so you can see if it helps your usecase.

If this is useful for other people as well we should nail down the
behaviour and have a go at implementing this properly. Note that things
might get a bit more complicated when you take binding into consideration.


Regards
Jorg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org