Jorge Godoy wrote: > "Michele Cella" <[EMAIL PROTECTED]> writes: > > > Anyway this is a wrong use case, if you are displaying two forms on the > > same page there is no problem but once the user submits one of the two > > you should redisplay (in case of errors) only the submitted one, > > How? Since usually we're relying on @expose() and redisplaying the whole > page... I don't imagine many people submitting data with AJAX so that they > can just replace the submitted form without changing the whole page again. >
The two forms I'm talking about are two different forms that happens to have some fields with the same name, anyway they will be validated and handled by two different methods so you can use a different error handler to redisplay them separately. > > For validation this is true, but I'm still interested about how to redisplay > just one form and keep the rest of the screen intact if I have, e.g., three > forms. > That seems a pretty bad UI to me, what's the use case you're trying to solve? > > Hmmmm... Isn't it possible to pass the form name as a key = value pair as > well? > That's what you can do (but it seems you haven't done) and I'm going to remove... ;-) > It doesn't look inconsistent to me... If I'm sending data to, e.g., > AutoCompleteField then I have to send it as > > values = dict(field_name = dict(text = data_text, id = data_integer)) > > Today we return: > > return dict(form = form_name, values = values) > > So... What is changing from that? Nothing. :-) > > Sorry, but why would display_field_for receive two forms at once? > That's the confusion I was talking about as you can see... display_field_for receives the name of the field you want to display not a form. > I agree that too many hacks are wrong... :-) Maybe we can change those to > "technical implementations" :-) (Just kidding) > :-) > > I have to test and see if things break... :-) If it is backwards compatible > with having more than 1 form on the same page (I have pages where I have more > than 10 small forms due to the lack of the "repetitive widget" to identify > which group of fields belong to which "thing" here). > It's totally backward compatible, it's my impression that no one and also you (from what you're saying) never used the full_qualified_form = True attribute (it's not easy to use ATM), so no problem from a backward compatible way. :-) Ciao Michele --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" 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-trunk -~----------~----~----~----~------~----~------~--~---
