[Zope3-Users] z3c.formjs, z3c.form.group and jsaction.handler

Nylan Nylan at gmx.net
Wed Apr 29 07:31:53 EDT 2009


Hello,

I've tried the following:

class GeneralInfo(group.Group):
    label=_(u'General info')
    fields=field.Fields(IUser).select('loginname','firstname','lastname','email')

.....

class UserAddForm(layout.FormLayoutSupport,group.GroupForm,form.AddForm):
    fields=field.Fields(IUser).omit('loginname','firstname','lastname','email',)
    groups=(GeneralInfo,OptionsInfo)

    @jsaction.handler(groups[0].fields['name'],event=jsevent.CHANGE)
    def handlerTest(self,event,selector):
        return 'alert("Works!");'


but it doesn't seem to work. The page is rendered correctly,but the alert part
for the selected widget above is missing.The page header contains only:
$(document).ready(function(){
})

Without Groupforms the UserAddForm works fine.
Putting the handler definition into the Group part doesn't seem to work either.
Do i miss something?

Help appreciated!
Thanks!





More information about the Zope3-users mailing list