[Seaside] registerObjectForBacktracking, submit and execute block
avi at beta4.com
Mon Aug 30 10:46:32 CEST 2004
On Aug 29, 2004, at 2:43 PM, Andreas Nilsson wrote:
> Ok, that makes sense, didn't know that it used an array internally.
> Any ideas of how to make backtracking work for adding / removing items
> from a collection?
> Somebody must have tried before ;)
It's a little ugly, and should be encapsulated, but you can use a
StateHolder holding an Array and use functional operations instead of
stateHolder := WAStateHolder new contents: #()
^ stateHolder contents
stateHolder contents: (self objects copyWith: anObject)
stateHolder contents: (self objects copyWithout: anObject)
More information about the Seaside