Re: [Zope3-Users] vary formlib render_submit_button by skin

2007-04-19 Thread Aleksander Kowalczyk

On 4/19/07, Christian Theune [EMAIL PROTECTED] wrote:


Am Mittwoch, den 18.04.2007, 17:09 -0400 schrieb Fred Drake:
 On 4/18/07, Leonardo Rochael [EMAIL PROTECTED] wrote:
  I was looking at formlib and I found that If i want to customize
widgets per
  skin, I just have to register their view to a different type, e.g.:

 As you can for all views.

  However I found no such way of customizing the render_submit_button
adapter
  per-skin. All examples I found of the action renderer declarations are
like
 ...
  Is there any way of specializing the action rendering per-skin? I
expect
  there to be one since it's html generation, which should be skinnable.

 It should be, but isn't.  :-(  I've run up against this as well, and
 working around it is more painful than it should be.

Do you consider it a bug? Is it tracked somewhere already?



I think I have similar problem with action renderer: I would like to attach
a javascript handler for my action button.
Unfortunately the renderer seems to not allow to pass any additional
attributes for the html button (like onclick attribute).

Leonardo,
you mentioned about overriding the renderer adapter. This could also solve
my problem, if possible. How to do that?

Regards!
_
Alek Kowalczyk
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] vary formlib render_submit_button by skin

2007-04-19 Thread Aleksander Kowalczyk

On 4/19/07, Marius Gedminas [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 to
attach
 a javascript handler for my action button.
 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.

 Leonardo,
 you mentioned about overriding the renderer adapter. This could also
solve
 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 /

I think I asked about similar thing some time ago - and the response I
received was no...

Regards!
Alek




--
_
Alek Kowalczyk
http://iblog.blox.pl
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] vary formlib render_submit_button by skin

2007-04-19 Thread Fred Drake

On 4/19/07, Christian Theune [EMAIL PROTECTED] wrote:

Do you consider it a bug? Is it tracked somewhere already?


Not a bug, but missing a useful feature.  I may have filed an issue
about it at some point, but really don't remember.


 -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Chaos is the score upon which reality is written. --Henry Miller
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] vary formlib render_submit_button by skin

2007-04-18 Thread Leonardo Rochael

Hi,

I was looking at formlib and I found that If i want to customize widgets per
skin, I just have to register their view to a different type, e.g.:

  view
  type=zope.app.skins.myskin
  for=zope.schema.interfaces.ITextLine
  provides=zope.app.form.interfaces.IInputWidget
  factory=.xmlformlib.XMLTextWidget
  permission=zope.Public
  /

where zope.app.skins.colskin comes from:

browser:skin
  name=myskin
  layers=mylayer default
  /

However I found no such way of customizing the render_submit_button adapter
per-skin. All examples I found of the action renderer declarations are like
(taken from Five):

configure
package=zope.formlib
xmlns=http://namespaces.zope.org/zope;
xmlns:i18n=http://namespaces.zope.org/i18n;
i18n_domain=zope.formlib

  [...]

  adapter
  factory=.form.render_submit_button
  name=render
  /
  [...]

Which leads me to think that I either have to override the adapter or have
my actions implement a more specialized interface than the default actions
so that I can configure my action renderer to it (or, what is simpler and
what I ended up doing, hardcode the rendering of actions in the form
template).

Is there any way of specializing the action rendering per-skin? I expect
there to be one since it's html generation, which should be skinnable.

Cheers, Leo
-- 
View this message in context: 
http://www.nabble.com/vary-formlib-render_submit_button-by-skin-tf3603242.html#a10066456
Sent from the Zope3 - users mailing list archive at Nabble.com.

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] vary formlib render_submit_button by skin

2007-04-18 Thread Fred Drake

On 4/18/07, Leonardo Rochael [EMAIL PROTECTED] wrote:

I was looking at formlib and I found that If i want to customize widgets per
skin, I just have to register their view to a different type, e.g.:


As you can for all views.


However I found no such way of customizing the render_submit_button adapter
per-skin. All examples I found of the action renderer declarations are like

...

Is there any way of specializing the action rendering per-skin? I expect
there to be one since it's html generation, which should be skinnable.


It should be, but isn't.  :-(  I've run up against this as well, and
working around it is more painful than it should be.


 -Fred

--
Fred L. Drake, Jr.fdrake at gmail.com
Chaos is the score upon which reality is written. --Henry Miller
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] vary formlib render_submit_button by skin

2007-04-18 Thread Christian Theune
Am Mittwoch, den 18.04.2007, 17:09 -0400 schrieb Fred Drake:
 On 4/18/07, Leonardo Rochael [EMAIL PROTECTED] wrote:
  I was looking at formlib and I found that If i want to customize widgets per
  skin, I just have to register their view to a different type, e.g.:
 
 As you can for all views.
 
  However I found no such way of customizing the render_submit_button adapter
  per-skin. All examples I found of the action renderer declarations are like
 ...
  Is there any way of specializing the action rendering per-skin? I expect
  there to be one since it's html generation, which should be skinnable.
 
 It should be, but isn't.  :-(  I've run up against this as well, and
 working around it is more painful than it should be.

Do you consider it a bug? Is it tracked somewhere already?

Christian

-- 
gocept gmbh  co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - [EMAIL PROTECTED] - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users