[Seaside] I have a possible solution to the puzzle at end of
renggli at gmail.com
Wed Jun 15 05:29:19 UTC 2011
> Thanks to Joachin Small World I have changed the code as follows:
> 1. Use cancelButton instead of submitButton in ConcatView.
> 2. Change the editContact as follows:
> editContact: aContact
> (editor contact: aContact) onAnswer: [ :answer |
> ifFalse: [
> self handleAnswer: false.
> ] .
> The code above works and the Cancel button works properly. I would like feedback
> as to the validity of the solution.
Hard to tell from the context given (The code looks suspicious to
assign multiple onAnswer: handler). The cancel button works fine as
long as the form is not submitted multiple times, such as for
validation. The easiest and most stable solution is to edit a copy of
the contact and to replace it in the collection on success.
> I had explored other solutions including:
> 1. Use of Magritte
> 2. Returning nil up the hierarchy on Cancel.
> 3. I had tried a variation of the solution suggested in Chapter 11.5, but that
> solution suffers from problems inherent in the example of Chapter 11.5 (only
> works when the the ContactViewList is rerendered). Removing the contact fails
> because when the button is reclicked, the list no longer contains the contact.
> P.S. This an old problem that had remained unsolved for me ( I posted the
> problem before)
> seaside mailing list
> seaside at lists.squeakfoundation.org
More information about the seaside