cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira ...@upaya.co.uk>
Subject Re: Limiting number of repeater rows in CForms
Date Sun, 04 Jul 2004 14:15:45 GMT
Derek Hohls wrote:

>This seems like it shoukld be a very simple
>thing to do, but I could not find answer yet...
>How do I set up a mechanism for limiting
>the numbers of rows that can can be added 
>to a repeater widget... ideally I'd also like
>to disable the "add" button when the no. of
>row = max.
>
>Thankls
>Derek
>
>  
>
You could do this within the FormHandler function, that you can pass to 
your form.

That will get an event with an action of something like 'add-row'. You 
can then query the form, count how many lines, and return false if you 
don't want it to add more lines.

See if you can work this out. If not, I'll dig out an example.

As to disabling, when I've done this, I've just passed everything 
necessary to make the decision as to whether or not to show a widget on 
into the stylesheet, so the stylesheet can then format the widget 
accordingly.

Make sense?

Regards, Upayavira



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


Mime
View raw message