[Product-Developers] kss/macros/IAdding in plone.app.z3cform

Carsten Senger senger at rehfisch.de
Tue Aug 5 20:35:10 UTC 2008


Hi there,

I could not find a bugtracker for plone.app.z3cform and plone.z3cform.
I have some patches for plone.app.form:

  * kss-Validate fields in groups/fieldsets:

    I would like to extend Z3CFormValidation to handle groups.
    At the moment the kssattr-formname is not set if has_groups is true
    (macros.pt:60). This ends in bad requests for
    kss_z3cform_inline_validation/validate_input because the attribute
    formname is missing.
    The validationview itself uses the kssattr's formname and fieldname.
    That's not enough to also check all groups enough cause there can be
    more than one field with the same name and the kss-command
    replaceInnerHTML makes funny things with the dom.
    The two ways I see are:

    * include the group into kssattr-fieldname.
    * include an other kssattr in a parent of the widget (e.g. the
      filedset).

    I implemented the latter. It doesn't change the api for css and has
    to inspect on widgetset. But im uncertain if it has any siteeffects.
    A patch is attached.

  * Make it possible to disable tabbing in forms with groups.
    Tabbing is automaticaly enabled with groups. But normal webusers can
    miss the tabs or dont't understand them which leads to a frustrating
    userexperience. I attached a patch that adds an optional attribute
    enable_tabbing to the form. This is not very elegant but works.

  * Optional disable kss-validation
    I would like to add a second optional attribute enable_kss_validation
    to disable the validation

  * Translate Errors in kss-validation
    KSSCommands don't handle i18nmessageid's. We have to translate them
    before calling core.replaceInnerHTML. A patch is attached.

  * What happend to the IAdding-View? I need it for plones contentmenu.
    plone.z3cform.add was removed shortly before I checked
    out plone.z3cform. Didn't know there had been some code I hacked
    together almost the same solution mixed from
    plone.app.content.browser.adding and Five.browser.adding with some
    small additions around the context-problems, and it works for me. Are
    there any specific problems or plans to support IAdding for plone
    3.x?

  * I tried to overwrite ploneform-macros with my own view.
    Is there an easy way?
    I tried to register for a more special layer interface,
    plone.theme.interfaces.IDefaultPloneLayer, that inherits from
    ICMFDefaultSkin, but my view isn't used.
    I tried to override the registration with an overrides.zcml but
    that's only picked up by five in products in the /Products-folder,
    which my product isn't.
    I tried to use includeOverrides but realised that it does not work
    when included in my own configure.zcml.
    At the end I put a *-overrides.zcml in packages-includes.
    In any way I would like to dokument it somewhere for me dump plone
    user.


If the patches are ok I apply them to plone.app.z3cform

..Carsten

-------------- next part --------------
A non-text attachment was scrubbed...
Name: group-validation.patch
Type: text/x-diff
Size: 6521 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20080805/88a62496/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kss-i18nmessages.patch
Type: text/x-diff
Size: 1048 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20080805/88a62496/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kssattr-formname.patch
Type: text/x-diff
Size: 982 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20080805/88a62496/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: optional_tabbing.patch
Type: text/x-diff
Size: 1249 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20080805/88a62496/attachment-0003.bin>


More information about the Product-Developers mailing list