[Zope-dev] z3c.formjs widgetselector customization

2011-02-15 Thread Simon Elbaz
Hi,
I use z3c.formjs in a project and would like to customize the selector id
used into jsaction.handler for form field.
Since the z3c.formui templates add -row suffix to the widget id, I need
also to add the -row suffix to the selector id in the event handler.

Here is the code in jsaction.py:

  # Step 1: Get the handler.
  handlers = widget.form.jshandlers.getHandlers(widget.field)
  # Step 2: Create a selector.
  selector_cls = queryUtility(interfaces.IWidgetSelector)
  if selector_cls is None:
  selector = WidgetSelector(widget)
  else:
  selector = selector_cls(widget)

If it is a good idea, how could I apply it to svn repository ?

Thx,
Simon
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] z3c.formjs widgetselector customization

2011-02-15 Thread Stephan Richter
On Tuesday, February 15, 2011, Simon Elbaz wrote:
 If it is a good idea, how could I apply it to svn repository ?

You can become a committer and check it into the Zope SVN repository. (I can 
be your reference.)

Feel free to make any changes to z3c.formjs you like. I can also aid you at 
making a release later.

Regards,
Stephan
-- 
Entrepreneur and Software Geek
Google me. Zope Stephan Richter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] z3c.formjs widgetselector customization

2011-02-14 Thread Simon Elbaz
Hi all,
I use z3c.formjs in a project and would like to customize the selector id
used into jsaction.handler for form field.
Why ? because the z3c.formui templates add -row suffix to the widget id
and I need also to add the -row suffix to the selector id in the event
handler.

I have attached a patch for the jsaction.py file that use the default
WidgetSelector class if no IWidgetSelector component is locally registered.

If it is a good idea, how could I apply it to svn repository ?

regards,
Simon


jsaction.py.patch
Description: Binary data
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )