formlib action rendering should be skin switchable

Bug #107755 reported by LeoRochael
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope 3
Won't Fix
Wishlist
Unassigned
zope.formlib
Invalid
Wishlist
Unassigned

Bug Description

Right now switching widgets by skin is easy enough by providing your own widget subclass and registering it for your own skin:

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

However switching action rendering by the skin is not provided for, as the .render() method of an action is actually a named template ("render"), and named templates are simple named adaptations to INamedTemplate. Customizing it involves either overriding the registration for the named "render" adapter for Action to NamedTemplate, or make your forms use an Action subclass, for which a new adapter can be provided, and these customizations still don't enable the rendering to change with the skin.

Suggestions:

- Make Action.render() a method that looks up a named "view" on the Action.

- Create a NamedViewTemplate, which expects it's 'instance' to be a view (i.e. have a 'request' attribute, and do "component.getMultiAdapter([instance, instance.request], INamedViewTemplate, self.__name__)" instead of "component.getAdapter(instance, INamedTemplate, self.__name__)".

The latter would also enable us to customize the form layout by skin, if we make the form template also be a NamedViewTemplate.

Changed in zope3:
importance: Undecided → Wishlist
status: Unconfirmed → Confirmed
Tres Seaver (tseaver)
Changed in zope.formlib:
status: New → Confirmed
importance: Undecided → Wishlist
Changed in zope3:
status: Confirmed → Won't Fix
Revision history for this message
Colin Watson (cjwatson) wrote :

The zope.formlib project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope.formlib.

Changed in zope.formlib:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.