[Cubicweb] CtxComponent and selectors

St├ęphane Bugat stephane.bugat at free.fr
Tue Oct 2 16:07:43 CEST 2012


> Check the primary view implementation : the toolbar is explicitly
> generated here, so you probably have to
> have similar code in desired view.

Sylvain, that was it! For those interested I had to enrich the call() method of the EntityView like this::

    def call(self, **kwargs):
        self.w(u'<div class="%s">' % 'ctxtoolbar')
        for comp in self._cw.vreg['ctxcomponents'].poss_visible_objects(
            self._cw, rset=self.cw_rset, view=self, context='ctxtoolbar'):
            # XXX bw compat code
            try:
                comp.render(w=self.w, row=self.cw_row, view=self)
            except TypeError:
                comp.render(w=self.w)
        self.w(u'</div>')
        super(ConversationView, self).call(**kwargs)

Worked pretty well ;-)
Great, many thanks

St├ęphane



More information about the Cubicweb mailing list