[Bese-devel] Getting at higher-level state in contained components

Tim Lavoie tim at fractaldragon.net
Tue Aug 30 05:59:06 UTC 2005


Hi all,

I've got a window component defined, where there are pieces which I
would like to use to control other components, or the top-level
window.

It starts out basically like this:

(defcomponent foo-window (template-component simple-window-component)
  ((nav1 :component side-nav1 :accessor foo-window.nav1)
   (body :component simple-container :accessor foo-window.body)
   (profile :component profile :accessor ww-profile))

  ........

The body is the main content area, nav1 would be something like the
typical side-bar navigation area, and profile is a user profile which
I've changed from defaults to results from an SQL query once they've
logged in.

What I would like to do ideally is get a reference in one component to
another, without manually hard-coding the path to use the appropriate
number of parent links. This does work, but is fragile in the face of
changing page structure. This allows me already to have navigation
links do something to the main content area as an example, or get
something from the profile.

Is there a nice way to define this sort of find-in-parents behaviour
already? It seems obvious, but I didn't find anything of the sort
already. I think it would work well and allow arbitrary nesting
without changing template code, which would be quite nice. Any
suggestions?

	Thanks,
	Tim




More information about the bese-devel mailing list