[Seaside] expiring pages
Avi Bryant
avi at beta4.com
Mon Jul 19 20:41:23 CEST 2004
On Jul 18, 2004, at 3:47 PM, radoslav hodnicak wrote:
> I'm doing a sort of hierarchy/tree editor (it just displays boxes
> connected with lines) and for some actions, I want to set the previous
> pages as expired, so that the user can't use the back button to change
> things.
>
> I know about session isolate: [] but I can't quite figure out how to
> use
> it here. This is seaside 2.3. The component works like
>
> -render all nodes
> -action to add/delete node
> -repeat until save/cancel
>
> So for example after the user deletes a node I want to make the
> previous
> pages expired so that they can't go back and work with the deleted
> node.
This sounds like a variation on #once:, which will expire each page
immediately - you'd want to wrap it around the call to your editor
component, so,
self session once: [self call: HierarchyEditor new].
But that wouldn't do quite what you want, since you only want the
expiry to happen after certain actions. So I think you need to
implement your own filter, using WAOnce as an example. Unlike WAOnce,
which records all the actionKeys it sees and then complains if it ever
sees them a second time, you'd want to keep a list of "expiredKeys",
and a list of "currentKeys", and have some message telling it to move
all the currentKeys into the expired list, that would be sent after
node deletion etc.
This is probably a common enough requirement that a filter/decoration
like this should be in the base. So let us know how it goes.
Avi
More information about the Seaside
mailing list