[Seaside] Re: Jquery Ajax confirm: callback problem
Joachim Tuchel
jtuchel at objektfabrik.de
Mon Jul 23 12:33:32 UTC 2012
Paul, Johan,
so this is what my code looks like right now:
s jQuery ajax
confirm: 'Do you really want to delete this object?';
script: [:t|
self deleteObject: obj.
t << (t jQuery id: link id) load "link is the anchor tag"
html: [:q | self renderChildrenOn: q]]
Which is a mix of your suggestions. It does work perfectly on Firefox: I
get asked if I want to delete, and only if I click OK the object is
deleted and the list is re-rendered.
On Chrome, however, I get the confirmation dialog and it does nothing if
I click cancel, but it also does nothing if I hit OK.
A breakpoint in #deleteObject: never fires. So it seems like the script:
doesn't work on Chrome (which I cannot believe).
Joachim
Am 20.07.12 19:00, schrieb Paul DeBruicker:
> On 07/19/2012 11:22 PM, Joachim Tuchel (objektfabrik) wrote:
>> Unfortunately, it doesn't work for me. It leaves me with a blank page on
>> Chrome and a text-only page containing teh html of the complete page
>> re-rendered. Even if I replace the jQuery this with the concrete ID of
>> my list, it doesn't work.
>>
>> Wouldn't a POST request reload the whole page anyways?
>>
>
>
> Sorry that didn't work. I think Johan was right about my missing parens.
>
> The ajax POST doesn't reload the whole page. It just sends the info
> to the server as a POST rather than GET which I'd thought was the
> thing to do if you were deleting something and a DELETE wasn't a
> supported part of the library.
>
>
> See: http://www.cs.tut.fi/~jkorpela/forms/methods.html &
> http://stackoverflow.com/questions/715335/get-vs-post-in-ajax#715355
>
> jQuery's ajax post docs are here: http://docs.jquery.com/Post
>
>
> I'll try to think of why else its not correct and get back to you.
--
--
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel mailto:jtuchel at objektfabrik.de
Fliederweg 1 http://www.objektfabrik.de
D-71640 Ludwigsburg http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5586 bytes
Desc: S/MIME Kryptografische Unterschrift
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20120723/16a32f19/smime.bin
More information about the seaside
mailing list