After a few weeks of fruitful and not so fruitful work sessions, I am slowly approaching the benchmark for a 0.1 release of z3c.formjs. So what will be provided in the 0.1 release?
- A demo of the above two features.
import zope.interface from z3c.form import form, button from z3c.formui import layout from z3c.formjs import jsbutton class IButtons(zope.interface.Interface): show = jsbutton.JSButton(title=u'Show Code') hide = jsbutton.JSButton(title=u'Hide Code') class ButtonForm(layout.FormLayoutSupport, form.EditForm): buttons = button.Buttons(IButtons) @jsbutton.handler(IButtons['show']) def handleShow(self, id): return '$("#code").slideDown()' @jsbutton.handler(IButtons['hide']) def handleHide(self, id): return '$("#code").slideUp()'
What about future releases?
@jsevent.handler(fields['state'], event=jsevent.CHANGED) def handleStateChange(self, id): return jsevent.updateWidgetFor(self.fields['city']).render()
But these are just thoughts at this point and the API is very likely to change as problems and their solutions are discovered.