You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Derek Hohls <dh...@csir.co.za> on 2004/07/04 10:11:30 UTC
Limiting number of repeater rows in CForms
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
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Limiting number of repeater rows in CForms
Posted by Upayavira <uv...@upaya.co.uk>.
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