<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
<meta charset="utf-8">Maybe try doing something like this?<div style="text-indent: 0px !important; "><br style="text-indent: 0px !important; "></div><div style="text-indent: 0px !important; ">...</div><div style="text-indent: 0px !important; ">onClick: ( html jQuery ajax script: [:s | self someMethodThatMayReturnJavascriptOn: html ] );</div><div style="text-indent: 0px !important; ">...</div><div style="text-indent: 0px !important; "><br style="text-indent: 0px !important; "></div><div style="text-indent: 0px !important; ">RS</div><br>> To: seaside@lists.squeakfoundation.org<br>> From: estebanlm@gmail.com<br>> Date: Wed, 3 Nov 2010 09:04:47 -0300<br>> Subject: [Seaside] Re: a problem using javascript goto and jquery and some        complex stuff<br>> <br>> Hi,<br>> What I really want is to force a page refresh, but decide when this is <br>> necesary inside a javascript callback. For example, I open a "confirm <br>> dialog"... y you cancel the operation, nothing happens, but if you <br>> agree, a new page is rendered (not an ajax part, a whole new page), <br>> this is more or less the behavior I'm needing (something like the large <br>> example below).<br>> btw... I tryed using "html jQuery ajax" instead "html jQuery get" (and <br>> in fact I also tested with "post"), with exactly the same result for <br>> this issue.<br>> <br>> Cheers,<br>> Esteban<br>> <br>> On 2010-11-03 03:54:17 -0300, Johan Brichau <johan@inceptive.be> said:<br>> <br>> > Hi Esteban,<br>> > <br>> > The goto makes your browser navigate to the url of an ajax callback.<br>> > That will execute the callback server-side but the response of that<br>> > callback is empty, hence the blank page. I think the use of #call: will<br>> > trigger a redirect in the callback, hence why that is working (just<br>> > writing this of the top of my head, did not verify). You either need to<br>> > use normal callbacks, or use jQuery to add or replace the html inline on<br>> > your webpage. Something along the lines of:<br>> > <br>> > html anchor                 <br>> >                 onClick: (html jQuery ajax<br>> >                                                 callback:[self<br>> > doSomethingLikeRemoveARow];<br>> >                                                 onComplete:(html jQuery<br>> > ajax) script:[:s | s << ((s jQuery expression: 'body') append: [:r |<br>> > tabsComponent renderOn: r]) ]);<br>> >                 with: 'goto blah'.<br>> > <br>> > -or-<br>> > <br>> > html anchor                 <br>> >                 callback: [self doSomethingLikeRemoveARow. self show:<br>> > tabsComponent ];<br>> >                 with: 'goto blah'.<br>> > <br>> > In the first case, it's important that you cancel the default behavior<br>> > of the anchor because otherwise it will execute a full callback instead<br>> > of an ajax request only. I'm always sending 'url: 'javascript:{}' to<br>> > such an anchor to cancel the default generated Seaside url, but there<br>> > are other ways.<br>> > <br>> > Hope it helps<br>> > Johan<br>> > <br>> > On 03 Nov 2010, at 01:09, Esteban Lorenzano wrote:<br>> > <br>> >> Hi,<br>> >> I have a problem dealing with some ajax renderization... I have<br>> > something like this:<br>> >> <br>> >>         html anchor                 onClick: (html javascript                         <br>> > goto: (html jQuery get                                 callback: [ self show:<br>> > tabsComponent ];<br>> >>                                 fullUrl));<br>> >>                 with: 'goto blah'.<br>> >> <br>> >> <br>> >> of course, this is not my real need, just a simplified version :)<br>> >> <br>> >> and whenever the callback is executed, it just renders a blank page...<br>> > but if I change the #show: for #call:, the new component is rendered<br>> > correctly... I think this is not correct, because same behavior is<br>> > happening in other contexts (for example, I want to execute a callback<br>> > after render a confirmation dialog, something like this:<br>> >> <br>> >>         | dialogId |<br>> >>         dialogId := html nextId.         self canvas div id: dialogId.<br>> >>         self canvas script: (html jQuery new dialog                 id:<br>> > dialogId;<br>> >>                 html: someComponent;<br>> >>                 title: 'Title;<br>> >>                 width: 600;<br>> >>                 addButton: 'Accept' do: (html javascript<br>> >>                         goto: (html jQuery get<br>> >>                                 callback: [<br>> >>                                         "This is fake code, but shows<br>> > what I need :)"<br>> >>                                         self doSomethingLikeRemoveARow.<br>> >>                                         self refreshReport ];<br>> >>                                 fullUrl));<br>> >>                 addButton: 'Cancel' do: html jQuery new dialog close;<br>> >>                 resizable: false;<br>> >>                 modal: true<br>> >>                 autoOpen: true).<br>> >> <br>> >> <br>> >> again, this is a simplified version of something I do for reef, but it<br>> > shows more or less what I want... and I get a blank page all the time...<br>> >> <br>> >> Any idea how to solve this?<br>> >> <br>> >> Cheers,<br>> >> Esteban<br>> >> <br>> >> <br>> >> _______________________________________________<br>> >> seaside mailing list<br>> >> seaside@lists.squeakfoundation.org<br>> >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br>> <br>> <br>> <br>> _______________________________________________<br>> seaside mailing list<br>> seaside@lists.squeakfoundation.org<br>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br>                                            </body>
</html>