[Bese-devel] reaching other objects
Pupeno
pupeno at pupeno.com
Fri Jun 3 00:39:13 UTC 2005
On Thursday 02 June 2005 16:23, Drew Crampsie wrote:
> What i do is keep the 'output component' in a slot of the 'menu'
> component like
>
> (defcomponent output ()
> ())
>
> (defcomponent menu ()
> ((output :initarg :output :accessor output))
>
> (defaction view-from-menu ((menu menu) component-to-view)
> (call-component (output menu) component-to-view))
Ok to that, but there are slithgt differences in my situation which makes the
difference I believe.
What you call here menu (in my case it's product-lister) is not a component
directly, but a presentation, it is defined as:
(defpresentation product-lister (list-presentation)
((product-name :label "Name" :slot-name 'name :editablep nil))
:editablep t
:Deleteablep t)
I've read the defpresentation macro, but I couldn't find how to put a slot
there (the slot would point to the content component).
The other problem, even when I solve that problem is view-from-menu, in my
case called view-product is defined as follows (I don't know what to put on
it yet):
(defaction view-product ((product product))
)
while it is called by present-slot:
(defmethod present-slot ((slot product-name-slot-presentation) instance)
(<ucw:a :action (view-product instance) (call-next-method)))
Now, I don't see a way to get a reference to the instance of product-lister to
view-product, because none gets to present-slot (and I don't control how
present-slot is called, do I).
I thought that maybe product-lister is referenced in a slot in the object
named slot (of class product-name-slot-presentation), but then I followed the
whole class hierarchy of product-name-slot-presentation
(string-slot-presentation and up) and I couldn't find any references to the
object where that slot is.
From here, I'm having a sense that UCW is missing 'a way to go up', it'd be
awesome to automatically have a parent slot in all components that point to
the component where that component is.
Thanks.
--
Pupeno <pupeno at pupeno.com> (http://pupeno.com)
Reading ? Science Fiction ? http://sfreaders.com.ar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/bese-devel/attachments/20050602/65710033/attachment.sig>
More information about the bese-devel
mailing list