Re: [Zope3-Users] Re: formlib.form.Action.render()

2005-09-27 Thread Christian Lueck
Ruslan Spivak wrote:

>> The action.render() call causes a component lookup error:
>>
>> 
>> Module formlibexample.browser, line 89, in renderActions
>> result.append(action.render())
>>   Module zope.formlib.namedtemplate, line 61, in __get__
>> return component.getAdapter(instance, INamedTemplate, self.__name__)
>>   Module zope.component, line 141, in getAdapter
>> raise ComponentLookupError(object, interface, name)
>> ComponentLookupError: (,
>> , 'render')
>>
>
>Looks like you didn't include `formlib` package into package-includes.
>  
>
Yes!

(Hmm, thought that I had posted this to the list, when I found out the
next day..)

Thanks,
Christian
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: formlib.form.Action.render()

2005-09-27 Thread Ruslan Spivak

> Hi there!
>
> I have a problem with formlib, form.Fields are rendered correctly :) but
> I got stuck with Actions
> Well, I followed the lines of formlib/form.txt
> but adapted the examples for use with ZPT by overridding the template
> method:
> template = ViewPageTemplateFile('mytemplate.pt')
>
> The widgets are rendered one by one by methods in the viewclass which
> return self.widgets['field_x']()
>
> That works fine :-)
> But when I try to get the action-objects rendered there is an exception.
>
> class Myform(EditForm):
> 
> def renderActions(self):
> result = []
> for action in self.actions:
> result.append(action.render())
> return '\n'.join(result)
>
> The action.render() call causes a component lookup error:
>
> 
> Module formlibexample.browser, line 89, in renderActions
> result.append(action.render())
>   Module zope.formlib.namedtemplate, line 61, in __get__
> return component.getAdapter(instance, INamedTemplate, self.__name__)
>   Module zope.component, line 141, in getAdapter
> raise ComponentLookupError(object, interface, name)
> ComponentLookupError: (,
> , 'render')
>

Looks like you didn't include `formlib` package into package-includes.

Regards,
Ruslan

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users