[Seaside] Anchor with submit and callback

Michel Bany m.bany at wanadoo.fr
Fri Nov 17 18:15:39 UTC 2006


Carl Gundel a écrit :
> When I use the code below the anchor submits, but it doesn't execute 
> the callback.  If I eliminate the submitFormNamed: then clicking 
> executes the callback, but of course then it doesn't submit the form.  
> Is it possible to have an anchor that does both?
>
> html anchor
>    id: 'cssID';
>    submitFormNamed: 'submitMe';
>    callback: [self doSomething];
>    text: 'Do something'.
Hi Carl,

This is very strange because WACanvasLinkSubmitTest is doing
exactly what you are trying to accomplish. This can be seen
at http://localhost:8008/seaside/go/tests/allcanvastests
where you select tab entitled "Submit"

Enter (say) 23 in the input field then click the "++" link, you
should get a value of 24 demonstrating that the form
was indeed submitted with all the callbacks executed.

The only difference I see is the order of the message sends,
and I believe this is important so that the javascript created
by #handlerForForm: also includes the callback key that has
been created earlier by the #callback: message

            html anchor
                id: #increaseLink;
                addShortcut: 'Ctrl-Up';
                callback: [count := count + 1];
                submitFormNamed: formId;
                text: '++'.

HTH
Michel.




More information about the Seaside mailing list