iain duncan <[EMAIL PROTECTED]> writes:

> On Tue, 2007-20-03 at 21:23 -0300, Jorge Godoy wrote:
>> Christopher Arndt <[EMAIL PROTECTED]> writes:
>> 
>> > I guess what he wants is to display error messages next to the fields that 
>> > had
>> > errors just like widget-based forms in a synchronous request-response cycle
>> > environment do. I would be hard to implement all this in java script in a
>> > generic way.
>> 
>> Hmmmm...  I don't believe it would be too hard.  A loop on a possible
>> tg_errors getting the keys (that names of tags) and filling then with the
>> value for such a key wouldn't be too hard. ;-)
>
> How would you handle the ajax then? The problem I'm having right now is
> that remoteform expects plain xhtml content instead of JSON, which is
> what I know how to use. I guess the remote form should be fetched the
> same way remote form fetches the response?

If it is expecting the form to be retrieve as xhtml -- I've never used such a
widget -- then you should render the form before returning and the widget
mechanism will deal with placing the errors in the correct places.  

     result = conversations_grid.render(conversations).decode('utf-8')

This renders a grid with "conversations" as values and places the resulting
HTML inside the result variable.

You'd have to do something like that but passing the errors dict as well so
that those errors can be rendered with the form.


-- 
Jorge Godoy      <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
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