I have this recurring pattern that pier doesnt appear to handle at all
well, so would be grateful for ideas.
I want to embed a component that "does stuff" then when it is finished
goes back to, whence it came.
Better still I would like to be able to go to a page, with an embedded
component, and when finished return to the place of origin. This would
allow the component to be decorated with other things on that page,
rather than just being a dry form like Commands are. (although
Pier-Annotations can spice them up a bit)
For example, I have a "New User Registration" component written for
seaside. It would normally be invoked via a "call", and would return
something or nil if the user cancelled. I am not so interested in the
return value.
So if I pop this component in to pier, I can get to it via a link, and
when I have finished "doing stuff", or if I click "cancel", then it
does... nothing. Ideally I want it to go back to the source of the link,
from whence I came.
I have never found a non-hacky way of doing this. The only clean way of
doing such things appears to be to wrap your component into a command.
I was kind of hoping that LightBox links could be persuaded to close if
the component drawn answers nil.
Solution's I have contemplated...
1) Have contexts keep a history so at least you can find out where to
return to.
Have pier handle all seaside components not just root components, any
answers that are received from a component, are put into
PRContext-properties in case anyone cares, and embedded components may
propagate their answers out to the PRContentsWidget which then uses the
History in the PRContext to go back to whence you came.
2) Some special form of link, which stores the current structure
somewhere, before going to the next destination.
any ideas?
Keith