Aleksander Kowalczyk wrote:
On 4/19/07, *Marius Gedminas* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
On Thu, Apr 19, 2007 at 11:20:07AM +0200, Aleksander Kowalczyk wrote:
> I think I have similar problem with action renderer: I would like
> Unfortunately the renderer seems to not allow to pass any additional
> attributes for the html button (like onclick attribute).
Yes. I recently needed to add a CSS class to an action button (in Zope
3.2 -- there's no time to port to 3.3/3.4 because Customers Demand
Features). In the end I subclassed zope.formlib.form.Action and made
render a regular method that did what I wanted it to do.
> you mentioned about overriding the renderer adapter. This could
> my problem, if possible. How to do that?
Reading zope/formlib/namedtemplate.txt might help. You either have to
use ZCML overrides, or subclass zope.formlib.form.Action (or
attach marker interfaces to its instances, although that might not work
given its copy-on-__get__ descriptorish behaviour).
Can I somehow override this directive (from formlib/configure.zcml) in
my instance's etc/overrides.zcml ?
<adapter factory=".form.render_submit_button" name="render" />
Sure you can. That's what ZCML overrides are for.
http://worldcookery.com -- Professional Zope documentation and training
Zope3-users mailing list