Hi Ksenia,

With TurboGears widgets, the behaviour is as you described; I expect the same is true for ToscaWidgets. I created the following, and you could do something similar:

class AutoRepeatingFieldSet(RepeatingFieldSet):
 def display(self, value=None, **params):
   if value and type(value) == list:
     params['repetitions'] = len(value)
   return super(AutoRepeatingFieldSet, self).display(value, **params)

For now you can create your own class. Really though, I think this should be part of standard functionality. One idea: if repititions is set to None, then it is automatically set to the length of the list.

Hope this helps,

Paul



Hi,

I was playing with tw_samples and have a question about "repetitions"
parameter of FormFieldRepeater. From js_forms.py:



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to