[Seaside] I have a possible solution to the puzzle at end of Chapter 12.2

Lukas Renggli 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:
> <code>
> editContact: aContact
>        (editor contact: aContact) onAnswer: [ :answer |
>                answer
>                ifFalse: [
>                        self handleAnswer: false.
>                        ] .
> ]
> </code>
>
> 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.

Lukas


>
> 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
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>



-- 
Lukas Renggli
www.lukas-renggli.ch


More information about the seaside mailing list