On Jul 10, 1:16 pm, "szabolcs.szucs" <[email protected]> wrote:
> Hey,
> I've already patched my version of weblocks in a way that :hidep slot
> of view-fields can be a lambda getting the object itself as argument.
> With this hack, you can implement data views where :hidep can depend
> on the object itself. As a basic example, I don't want to show object
> slots having certain values (like nil, empty string, etc.) or hiding
> slots from the view depending on the state of the data object. It's in
> the file utils.lisp (http://bitbucket.org/S11001001/weblocks-dev/src/
> tip/src/views/view/utils.lisp) lines 93-96 (actually). I've changed it
> as follows:
>
> (inline-view-field
>    (when (or include-invisible-p
>              (let ((hidep-val (view-field-hide-p vfield)))
>                (if (functionp hidep-val)
>                    (funcall hidep-val obj)
>                    (not hidep-val))))
>      (funcall proc vfield-info)))
>
> My question is more about the current way to implement such behaviour.
> Is it possible in any way to do something like this now? (I mean a
> more sophisticated one : )

I usually don't use data views.

I'd be happy to include your patch, but isn't it easier to just define
a smart accessor for view-field-hide-p that calls the function
in the slot?

  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.

Reply via email to