Getting at other components/sibblings (was: [Bese-devel] Getting at higher-level state in contained components)

Pierre-François Gomez pef.gomez at gmail.com
Fri Sep 2 11:33:28 UTC 2005


2005/8/30, Tim Lavoie <tim at fractaldragon.net>:
> 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.

[note: having written this, i realize most of this issue have already
been answered and it may just seem obvious : please consider this more
like a "is this the right way to do it ?" question :) ]

Hi,

I think i will soon share Tim Lavoie's need here and i thought i would
just take this opportunity to ask for your opinion :)

Just let me explain first what i want to achieve to make sure we're
speaking of the same kind of problem.

My main window component is a tabbed pane. Among the panes it holds,
the first one of interest is just rendering a list of "actions" (my
terminology here, not ucw's), some of which being "project actions"
with an associated project. "project actions" each are rendered as two
links. Roughly, it looks like this :

(loop for project in (all-projects)
        for action (project.next-action project)
  (<:li
    (<ucw:a :action (next-actions.edit-action n-a action)
                (<:as-html (action.outcome action)))
    (<ucw:a :action (next-actions.switch-to-project n-a project)
                (<:as-html (project.name project)))))

Now the second pane of interest is an index of existing projects,
rendered as links (ie. calls) to a view of the particular project.

What i'd like to achieve is for switch-to-project to not only make the
tabbed pane switch to the projects pane (this part has worked when if
first tried using switch-component on the parent, IIRC), but also make
the projects pane display the right project.

For now, switch-to-project is just calling a project view "dialog"
which just answers when i'm finished with it. I'm pretty pleased with
this, but for the fact that when cliking on a project from its "next
action" in the next actions pane, i stay in this pane. This is the
behavior i'd like to fix.

An approach would be to modify my project pane component so that it
holds the project to be displayed in a slot. This slot would default
to nil to display the index of all projects. Then i would just setf
this slot to the new project before calling switch-component.

Thanks to marco's answer to your post, i now have a clearer view of
how i can manage to "just" setf this slot from my next-actions pane
(by informing my next-actions pane of the projects pane, i guess).

I've not given much time to this, and i hope i was clear. Would this
work ? How would you do this ?

Thanks for your time,

-- Pierre-François Gomez -- GnuPG 0x5F77196E



More information about the bese-devel mailing list