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