Newbie question. Google has been no help at all. Besides, the problem I have is kinda hard to explain properly.
I have two components in my application: a JournalView and a JournalEntryView. The JournalView displays a list of journal entries with links to individual entries. When clicked, each of these links should create a new JournalEntryView and redirect to this newly created JournalEntryView.
Currently, I do this:
html anchor
callback: [
entryView := JournalEntryView new.
entryView entry: anEntry.
self call: entryView ];
with: '(read more)' ]
Problem is, this code expects the newly created component to answer with a value later. Looking at the halos, I can see the following hierarchy of components:
JournalView
WADelegation
WAAnswerHandler
JournalEntryView
I don't want this. I want my JournalEntryView to be a toplevel view and I just want my anchors to redirect to a new toplevel JournalEntryView.
Is this possible in Seaside?
You can use announcements. It should be something like this:
then, when you declare ComponentA. You do something like this:
This way you are announcing your parent something has happened and your parent can react.
This approach works most of the time, but you need to add machinery to components to react to announcements (there are not ready by default). If you can, better approach is to create your own Component class, in top of your hierarchy, who can handle announcements. There are some of examples around (in Pharo)...
Hope this helps :)