On Tue, Jul 13, 2010 at 11:00:12PM -0700, szabolcs.szucs wrote:
> Sure.. : D
>
> There's class 'A, a view of it called 'VA, and there's a field 'F in
> that view 'VA. As far as I understood, your assumption was about
> overriding view-field-hide-p reader of the 'view-field class. In that
> case you have access to the 'view-field object only, and not the
> instance of class 'A you want to render (afaik). Therefore I'm not
> able to decide in the reader function (view-field-hide-p) based on the
> original object (from class 'A) I'm in order to render. I probably
> missed the point : )
Ah, yes. Code will help. :)
I was suggesting the following:
(defmethod view-field-hide-p ((field data-view-field))
(let ((value (call-next-method)))
(if (functionp value)
(funcall value *object*)
value)))
You are right, the method doesn't know about the current
object displayed through the data view. And since views
are singletons we can't use back links.
One solution (that is hinted at in the code snippet above)
is to bind *object* dynamically in the rendering pipeline
so we can refer to it here.
Leslie
--
You received this message because you are subscribed to the Google Groups
"weblocks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/weblocks?hl=en.