|
From: Jonathan V. <jva...@2x...> - 2012-02-22 23:52:30
|
Thanks Chris. I knew about being able to specify & pass custom formatters. I wanted to avoid that, and rely on the auto error. I guess i wanted a clue on how to patch formencode. My issue is with the behavior I illustrated below, which I would consider a bug. One would assume that if you pass in the "auto_error_formatter" argument, it would be used for generating ALL errors. Instead it generates errors only for html input type elements, and does not format the form:error blocks. On Feb 5, 2012, at 10:42 AM, Chris Lambacher wrote: > You should be able to use the formatter attribute to specify a custom formatter: > http://www.formencode.org/en/latest/htmlfill.html#errors: > <form:error name="field_name" format="formatter"> > > You will also need to provide the error_formatters argument to renderer if the formatter you want to use is not one of the default ones: > http://www.formencode.org/en/latest/modules/htmlfill.html#formencode.htmlfill.render > > -Chris > > On Sat, Feb 4, 2012 at 3:11 PM, Jonathan Vanasco <jva...@2x...> wrote: > > i'm a little confused by htmlfill's behavior on this. > > Given a form like this: > <form:error name="Error_Main"/> > <input id="login-email_address" name="email_address" placeholder="Email Address" size="30" type="text" /> > <input id="login-password" name="password" placeholder="Password" size="30" type="password" /> > > and a call to htmlfill with this: > formencode.htmlfill.render(\ > form_content, > defaults=defaults, > errors=errors, > auto_error_formatter=custom_formatter > ) > > My output is essentially this: > Error Main -- rendered with default formatter > email_address -- rendered with custom formatter > password -- rendered with custom formatter > > anyone have an idea to get the Error_Main section to render with the custom formatter along with the other fields (aside from specifying a custom renderer in the field and passing in a dict )? > ------------------------------------------------------------------------------ > Try before you buy = See our experts in action! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-dev2 > _______________________________________________ > FormEncode-discuss mailing list > For...@li... > https://lists.sourceforge.net/lists/listinfo/formencode-discuss > > > > -- > Christopher Lambacher > ch...@ka... // Jonathan Vanasco c. 646.729.6436 | 415.501.9815 e. jon...@2x... w. http://findmeon.com/user/jvanasco linkedin. http://linkedin.com/in/jonathanvanasco blog. http://destructuring.net |