[z3-five] zc.table sorting / resourceLibrary dependency

Dennis Schulz d.schulz81 at gmx.net
Wed Nov 15 11:31:20 CET 2006


I think I know know what my problem is:

I removed the

  <resourceLibrary name="zc.table">
    <directory source="resources" include="sorting.js"/>
  </resourceLibrary>

dependency from the zc.table configure.zcml because in an older posting 
I read that resourceLibrary doesn't work on Zope 2 and one can get rid 
off the dependency without problems.

However, when you use sorting, the ui renderer wants to look up the java 
script and cant find it.

How to solve this? (Changes to the zcml statement or change the 
zc.table.table code?)
Anyone managed a working StandaloneSortFormatter on Zope 2?


Dennis




-------- Original-Nachricht --------
Datum: Tue, 14 Nov 2006 20:55:37 +0100
Von: Dennis Schulz <d.schulz81 at gmx.net>
An: z3-five at codespeak.net
Betreff: [z3-five] zc.table sorting

 > Sorry, but the adding of <include package="zc.table" /> in my
 > configure.zcml didn't change anything.
 >
 > Here the way I call the Formater:
 >
 >        self.table = table.StandaloneSortFormatter(self.context,
 >                                                    self.request,
 >                                                    results,
 >                                                    columns=columns,
 >                                                    batch_start=0,
 >                                                    batch_size=2,
 >                                                    sort_on=(('name',
 > True),))
 >  
 > The problem is that the adapter can't be found in the rendering method
 > ....
 >
 >   Module zc.table.table, line 354, in _addSortUi
 >   Module zope.component, line 141, in getAdapter
 >
 >
 > Can anyone tell me how to interpret this line exactly
 >
 > ComponentLookupError: (<HTTPRequest,
 > 
URL=http://localhost:8080/dennis/applications/purchaserequisition.2006-11-07.5098603683/tableview.html>,
 > <InterfaceClass zope.interface.Interface>, 'zc.table')
 >
 > the view behind tableview.html can't lookup the component with the name
 > "zc.table" and zope.interface.Interface cant be adapted?
 >
 > how can I solve this?
 >
 >
 >
 > Dennis
 >
 >
 >
 >
 >
 > > Dennis Schulz wrote:
 > > > Hi,
 > > > I have tried to sort my columns by the following code that I found
 > > in various examples around:
 > > >
 > > > columns = [
 > > >     GetterColumn(name=u'name', title=u'Full Name', getter=lambda i,
 > > f: '<a href="tableview.html?display=view&id=%s">%s</a>' %
 > > (quote(i.name), i.name), subsort=True),
 > > >     GetterColumn(name=u'description', title=u'Full Description',
 > > getter=lambda i, f: i.description, subsort=True),
 > > >     GetterColumn(name=u'purchasingclass', title=u'Purchasing Class',
 > > getter=lambda i, f: i.purchasingClass.name, subsort=True)
 > > >     ]
 > > >
 > > > for c in columns:
 > > >     directlyProvides(c, zc.table.interfaces.ISortableColumn)
 > > >
 > > >
 > > > I get the following error and traceback:
 > > > ( I use Zope 2.9.5, Plone 2.5.1, Five 1.4.1, zc.table 0.6 py 2.4.egg,
 > > > are there any proves that zc.table sorting works with this zope
 > > version??)
 > >
 > > No idea. But from the looks of it it seems that you didn't include
 > > zc.table's configuration. You need <include package="zc.table" />
 > > somewhere in your ZCML tree (site.zcml,
 > > package-includes/*-configure.zcml, your Product's configure.zcml, 
etc.).
 > >
 > >
 > >
 > > --
 > > http://worldcookery.com
 > >
 > 
<http://service.gmx.net/de/cgi/derefer?DEST=http%3A%2F%2Fworldcookery.com>
 > > -- Professional Zope documentation and training
 > >
 > > _______________________________________________
 > > z3-five mailing list
 > > z3-five at codespeak.net
 > > http://codespeak.net/mailman/listinfo/z3-five
 > >
 > 
<http://service.gmx.net/de/cgi/derefer?DEST=http%3A%2F%2Fcodespeak.net%2Fmailman%2Flistinfo%2Fz3-five>
 >
 > _______________________________________________
 > z3-five mailing list
 > z3-five at codespeak.net
 > http://codespeak.net/mailman/listinfo/z3-five



More information about the z3-five mailing list