Hi there,
I am trying to port a Seaside Application from VA Smalltalk 8.6. to 8.6.3. That includes porting from Seaside 3.0 (?) to Seaside 3.2. After some troubles with addLoadScript:, which needed documented changes, I now am at a point where most of my Ajax callbacks don't work. I debugged a little and found out that the callbacks really aren't found in the callback registry. The reason seems to be WAUrl which parses URLs incorrectly. At least I think so. Please try this in your image: WAUrl absolute: '/Buchhaltung?_s=F4N82ZReQEV2M1cP&_k=spf8TDq4kzHfrPCi&48&searchText=kas' (48 is the key of my Ajax callback, as you might have guessed) This works in VA Smalltalk 8.6 and in Pharo 5 with Seaside 3.0. # In VAST 8.6.3 it yields a strange result: The queryFields of the resulting WAUrl have the following keys: ('_s' '_k' '48&searchText' 'searchText' nil nil) --> That seems to be definitely wrong!!! The keys should be ('_s' '_k' '48' 'searchText' nil nil) # In Pharo 5 with Seaside 3.2, the above expression yields a debugger with a primitiveFailed Error, because it tries to create a ByteString of Size -12. So WAUrl parses the callback (48) wrongly Here is what I loaded into Pharo 5 (50770): Metacello new configuration: 'Seaside3'; repository: 'http://www.smalltalkhub.com/mc/Seaside/MetacelloConfigurations/main'; version: #'release3.2'; load. Is this a known issue? Is there a fix for it? Has the logic for registering and finding callbacks changed between 3.0 and 3.2, so do I have to change my javascript code that issues ajax callbacks? Thanks for reading, Joachim _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
On Tue, Feb 28, 2017 at 4:26 PM, [hidden email]
<[hidden email]> wrote: > Hi there, >... > Is this a known issue? Now it is. > Is there a fix for it? Now there is https://github.com/SeasideSt/Seaside/issues/909 Cheers Philippe _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Hi Philippe,...
>> Is this a known issue? > Now it is. ;-) Thanks! > >> Is there a fix for it? > Now there is > https://github.com/SeasideSt/Seaside/issues/909 I am currently working on a fix (in VA Smalltalk), but it seems I can stop now ;-) I must now reveal my complete ignorance towards github. I can't see if there code for the fix or just the closed issue... How can I read or load the code change? Joachim -- ----------------------------------------------------------------------- Objektfabrik Joachim Tuchel mailto:[hidden email] 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 _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Ha, found it!
Slowly working on my Pharo / Monticello Yellow Belt ;-) Again, thanks a lot! Joachim Am 28.02.17 um 19:30 schrieb [hidden email]: > Hi Philippe,... >>> Is this a known issue? >> Now it is. > > ;-) Thanks! > >> >>> Is there a fix for it? >> Now there is >> https://github.com/SeasideSt/Seaside/issues/909 > > I am currently working on a fix (in VA Smalltalk), but it seems I can > stop now ;-) > > > I must now reveal my complete ignorance towards github. I can't see if > there code for the fix or just the closed issue... > How can I read or load the code change? > > Joachim > > -- ----------------------------------------------------------------------- Objektfabrik Joachim Tuchel mailto:[hidden email] 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 _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Philippe,
I just wanted to confirm your fix works perfectly. All my Ajax callbacks are back again on VAST 8.6.3 ;-) My fix would have had one extra line, so yours is much nicer. Joachim -- ----------------------------------------------------------------------- Objektfabrik Joachim Tuchel mailto:[hidden email] 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 _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Hi all,
I have a relatively short process (about 5 to 10 seconds) that I would like to show the progress of. It’s triggered by ajax: html button bePush; onClick: (html jQuery ajax script: [ :s | self fetchShowingProgressOnScript: s ]); fetchShowingProgressOnScript: s s << (s jQuery id: ‘progress') html: [ :r | r paragraph: 'Connecting to Downer...' ]. integration connect. s << (s jQuery id: ‘progress') html: [ :r | r paragraph: 'Logging In...' ]. integration login. s << (s jQuery id: ‘progress') html: [ :r | r paragraph: 'Looking up ' , self idToFetch ]. integration find: self idToFetch.. s << (s jQuery id: ‘progress') html: [ :r | r paragraph: 'Done.' ]. integration quit However this won’t work because the script will not be returned to the browser until the method completes. What’s the recommended way of going about this? Can you push a partial result without a streaming server? Is there a way of doing this without some kind of polling loop and running the long operation in a separate thread? Cheers, Jupiter _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Jupiter.
not a perfect answer, but what I'd try is forking the actual processing as a background process on the server and add two inst vars to the component: * processingDone * currentProgressMessage which would be updated by the background process as it progresses through its job. The first ajax call would be finished right after forking the background process, so teh browser would get an instant answer. All you need to do then is set up a timeOut() and have the browser ask for the current progress by issueing ajax calls every, say, 750-1000msec, until the server responds with "processingDone=true". The problem is, I have written something like this in Javascript, where I registered a callback for the progress message in renderContentOn: , but have no idea how to do it in Seaside's javascript rendering methods. I hope this idea helps you get a step further. Joachim Am 03.03.17 um 03:54 schrieb Jupiter Jones: > Hi all, > > I have a relatively short process (about 5 to 10 seconds) that I would like to show the progress of. > > It’s triggered by ajax: > > html button > bePush; > onClick: > (html jQuery ajax script: [ :s | self fetchShowingProgressOnScript: s ]); > > fetchShowingProgressOnScript: s > > s << (s jQuery id: ‘progress') > html: [ :r | r paragraph: 'Connecting to Downer...' ]. > integration connect. > s << (s jQuery id: ‘progress') > html: [ :r | r paragraph: 'Logging In...' ]. > integration login. > s << (s jQuery id: ‘progress') > html: [ :r | r paragraph: 'Looking up ' , self idToFetch ]. > integration find: self idToFetch.. > s << (s jQuery id: ‘progress') html: [ :r | r paragraph: 'Done.' ]. > integration quit > > However this won’t work because the script will not be returned to the browser until the method completes. > > What’s the recommended way of going about this? Can you push a partial result without a streaming server? > > Is there a way of doing this without some kind of polling loop and running the long operation in a separate thread? > > Cheers, > > Jupiter > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside -- ----------------------------------------------------------------------- Objektfabrik Joachim Tuchel mailto:[hidden email] 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 _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Hi Joachim,
Thanks for your response. I’m pretty sure this is how I’ll need to deal with it. I’m deploying on GemStone so this approach requires a bit more work to implement well - I was hoping there was a poor-mans solution :) Cheers, J > On 3 Mar 2017, at 3:33 pm, [hidden email] wrote: > > Jupiter. > > not a perfect answer, but what I'd try is forking the actual processing as a background process on the server and add two inst vars to the component: > > * processingDone > * currentProgressMessage > > which would be updated by the background process as it progresses through its job. > > The first ajax call would be finished right after forking the background process, so teh browser would get an instant answer. All you need to do then is set up a timeOut() and have the browser ask for the current progress by issueing ajax calls every, say, 750-1000msec, until the server responds with "processingDone=true". > > The problem is, I have written something like this in Javascript, where I registered a callback for the progress message in renderContentOn: , but have no idea how to do it in Seaside's javascript rendering methods. > > I hope this idea helps you get a step further. > > Joachim > > > > > Am 03.03.17 um 03:54 schrieb Jupiter Jones: >> Hi all, >> >> I have a relatively short process (about 5 to 10 seconds) that I would like to show the progress of. >> >> It’s triggered by ajax: >> >> html button >> bePush; >> onClick: >> (html jQuery ajax script: [ :s | self fetchShowingProgressOnScript: s ]); >> >> fetchShowingProgressOnScript: s >> >> s << (s jQuery id: ‘progress') >> html: [ :r | r paragraph: 'Connecting to Downer...' ]. >> integration connect. >> s << (s jQuery id: ‘progress') >> html: [ :r | r paragraph: 'Logging In...' ]. >> integration login. >> s << (s jQuery id: ‘progress') >> html: [ :r | r paragraph: 'Looking up ' , self idToFetch ]. >> integration find: self idToFetch.. >> s << (s jQuery id: ‘progress') html: [ :r | r paragraph: 'Done.' ]. >> integration quit >> >> However this won’t work because the script will not be returned to the browser until the method completes. >> >> What’s the recommended way of going about this? Can you push a partial result without a streaming server? >> >> Is there a way of doing this without some kind of polling loop and running the long operation in a separate thread? >> >> Cheers, >> >> Jupiter >> _______________________________________________ >> seaside mailing list >> [hidden email] >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > > > -- > ----------------------------------------------------------------------- > Objektfabrik Joachim Tuchel mailto:[hidden email] > 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 > > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by JupiterJones
On 03/03/2017 03:54, Jupiter Jones wrote:
> Hi all, > > I have a relatively short process (about 5 to 10 seconds) that I would like to show the progress of. > > It’s triggered by ajax: > > html button > bePush; > onClick: > (html jQuery ajax script: [ :s | self fetchShowingProgressOnScript: s ]); > > fetchShowingProgressOnScript: s > > s << (s jQuery id: ‘progress') > html: [ :r | r paragraph: 'Connecting to Downer...' ]. > integration connect. > s << (s jQuery id: ‘progress') > html: [ :r | r paragraph: 'Logging In...' ]. > integration login. > s << (s jQuery id: ‘progress') > html: [ :r | r paragraph: 'Looking up ' , self idToFetch ]. > integration find: self idToFetch.. > s << (s jQuery id: ‘progress') html: [ :r | r paragraph: 'Done.' ]. > integration quit > > However this won’t work because the script will not be returned to the browser until the method completes. > > What’s the recommended way of going about this? Can you push a partial result without a streaming server? > > Is there a way of doing this without some kind of polling loop and running the long operation in a separate thread? > > Cheers, > > Jupiter > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > I did not try it but I remember seeing a tuto on progress bar: http://pillarhub.pharocloud.com/hub/mikefilonov/ajaxupdateseaside I hope it can help you :) -- Cyril Ferlicot http://www.synectique.eu 2 rue Jacques Prévert 01, 59650 Villeneuve d'ascq France _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside signature.asc (817 bytes) Download Attachment |
In reply to this post by jtuchel
Hi, I do this within a modal handleCreditCardForm(options) { var aProgress = $t.application.makeProgressBar("20","20% Processing"); $('#processProgressIDl').replaceWith(aProgress); $t.application.updateprogressBarInTime(2000,"30","40% Processing ...") ; $t.application.updateprogressBarInTime(3000,"40","40% Processing Credit card") ; $t.application.updateprogressBarInTime(4000,"50","50% Processing Credit card") ; $t.application.updateprogressBarInTime(5000,"60","60% Processing Credit card") ; $t.application.updateprogressBarInTime(6000,"70","70% Processing Credit card") ; $t.application.updateprogressBarInTime(7000,"80","80% Processing Credit card") ; $t.application.updateprogressBarInTime(8000,"90","90% Processing Credit card") ; $t.application.updateprogressBarInTime(9000,"98","98% Processing Credit card") ; return this.handleCreditCardToServer("register-creditcard", options); Where: makeProgressBar(aValue,aText){ var aProgress = this.elementNameClass("div", "progress-bar progress-bar-success progress-bar-striped active"); aProgress.setAttribute("role", "progressbar"); var str1 ="width: "; var str2 = aValue.toString(); var mywidth = str1.concat(str2).concat("%"); aProgress.setAttribute("id", "processProgressIDl"); aProgress.setAttribute("aria-valuenow", Number(aValue)); aProgress.setAttribute("aria-valuemin", "0"); aProgress.setAttribute("aria-valuemax", "100"); aProgress.setAttribute("style", mywidth); //var newSpan = $t.application.spanWithClassText("sr-only","60% Cretating Licences"); var newSpan = this.spanWithClassText("sr-only",aText); aProgress.appendChild(newSpan); return aProgress; } And: updateprogressBarInTime(mymiliseconds,myPercentage,myText) { //for creating a new server as opposed to adding a preconfigured server. //return a ServerResponse //alert("Hi this is me handleCreditCardForm"); setTimeout(function(){ if ($t.application.session["showwaitdialog"] ) { // var aProgress = $t.application.makeProgressBar(myPercentage,myText); $('#processProgressIDl').replaceWith(aProgress); } else {$('#processingModalID').modal('hide'); } }, mymiliseconds); You can call $('#processingModalID').modal('hide'); if you are finished before Hope this gives indications Regards, Maarten MOSTERT
_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |