Thanks for your help so far.
According to Lukas we should 'say it in Seaside' - but we can't directly; we have to play games. _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
They have to be consistent, yes.
The Seaside factory classes will make that a non-issue. The javascript classes Lukas built have all the functionality you need... it's a matter of learning how to do it. Boris gave a great example. If you want to write out the javascript, then concatenate the strings and simply escape when you need to. ie. '"I''m a Smalltalk string in double quotes"'. '''I''m a Smalltalk string in single quotes'''. Would look like, printed: "I'm a Smalltalk string in double quotes" 'I'm a Smalltalk string in single quotes' I'm failing to see where the problem is. It sounds like a matter of looking at what, precisely, you want, and then translating it to syntax. RS > To: seaside@lists.squeakfoundation.org > From: intrader.intrader@gmail.com > Date: Fri, 4 Feb 2011 22:34:12 +0000 > Subject: [Seaside] Re: I would like to attach an onClick event according to > > Thanks for your help so far. > > According to Lukas we should 'say it in Seaside' - but we can't directly; we have > > to play games. > > _______________________________________________ > seaside mailing list > seaside@lists.squeakfoundation.org > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
I agree that your are failing to see the problem. I have the most efficient way
to to what I want given by the JavaScript: <most direct way to do this> $('#external_links a').click(function() { return confirm('You are going to visit: ' + this.href); }); </most direct way to do this> And I can't do it in Seaside without having to take care of special requirements about strings in the click method (onClick) <the direct way does not work> html button onClick: ((html jQuery expression: '#external_links a') onClick: 'return confirm("You are going to visit: "+ this.href)'); with: 'Attach Click'. </the direct way does not work> If does not work because the onClick message enclosed the whole argument in double quotes, sand the converts single quotes to double quotes (incorrectly) with the <resulting incorrect javascript> <button onclick="$("#external_links a").click(function(){return confirm("You are going to visit: "+ this.href)})" type="submit" class="submit">Attach Click</button> </resulting incorrect javascript) So think about it and write it in Seaside in a short, concise, and 'say it in Seaside' mode. <I have tried> html button onClick: ((html jQuery expression: selector) onClick: 'return confirm("You are going to visit: "+ this.href)'); with: 'Attach Click' </I have tried> with select set to 'external_links a', but with the same bad result (nested double quotes). Thanks _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Boris Popov, DeepCove Labs (SNN)
works in VisualWorks.
I need to 'say it in Seaside' _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Intrader Intrader
I'll look at it when I get home, although I did send you a working example last night.
If you don't have the e-mail, it's in the list archives. RS > To: seaside@lists.squeakfoundation.org > From: intrader.intrader@gmail.com > Date: Fri, 4 Feb 2011 23:19:41 +0000 > Subject: [Seaside] Re: I would like to attach an onClick event according to > > I agree that your are failing to see the problem. I have the most efficient way > to to what I want given by the JavaScript: > <most direct way to do this> > $('#external_links a').click(function() { > return confirm('You are going to visit: ' + this.href); > }); > </most direct way to do this> > And I can't do it in Seaside without having to take care of special requirements > about strings in the click method (onClick) > > <the direct way does not work> > html button > onClick: ((html jQuery expression: '#external_links a') onClick: 'return > confirm("You are going to visit: "+ this.href)'); > with: 'Attach Click'. > </the direct way does not work> > If does not work because the onClick message enclosed the whole argument in > double quotes, sand the converts single quotes to double quotes (incorrectly) > with the > <resulting incorrect javascript> > <button onclick="$("#external_links a").click(function(){return confirm("You are > going to visit: "+ this.href)})" type="submit" class="submit">Attach > Click</button> > </resulting incorrect javascript) > So think about it and write it in Seaside in a short, concise, and 'say it in > Seaside' mode. > <I have tried> > html button > onClick: ((html jQuery expression: selector) > onClick: 'return confirm("You are going to > visit: "+ this.href)'); > with: 'Attach Click' > </I have tried> > with select set to 'external_links a', but with the same bad result (nested > double quotes). > Thanks > > > > _______________________________________________ > seaside mailing list > seaside@lists.squeakfoundation.org > 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 Intrader Intrader
Whats wrong with my examples then? Also, you want it run on load not when you click some button, right?
Sent from my iPhone On 2011-02-04, at 6:19 PM, "Fritz Schenk" <[hidden email]> wrote: > I agree that your are failing to see the problem. I have the most efficient way > to to what I want given by the JavaScript: > <most direct way to do this> > $('#external_links a').click(function() { > return confirm('You are going to visit: ' + this.href); > }); > </most direct way to do this> > And I can't do it in Seaside without having to take care of special requirements > about strings in the click method (onClick) > > <the direct way does not work> > html button > onClick: ((html jQuery expression: '#external_links a') onClick: 'return > confirm("You are going to visit: "+ this.href)'); > with: 'Attach Click'. > </the direct way does not work> > If does not work because the onClick message enclosed the whole argument in > double quotes, sand the converts single quotes to double quotes (incorrectly) > with the > <resulting incorrect javascript> > <button onclick="$("#external_links a").click(function(){return confirm("You are > going to visit: "+ this.href)})" type="submit" class="submit">Attach > Click</button> > </resulting incorrect javascript) > So think about it and write it in Seaside in a short, concise, and 'say it in > Seaside' mode. > <I have tried> > html button > onClick: ((html jQuery expression: selector) > onClick: 'return confirm("You are going to > visit: "+ this.href)'); > with: 'Attach Click' > </I have tried> > with select set to 'external_links a', but with the same bad result (nested > double quotes). > Thanks > > > > _______________________________________________ > 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 |
Boris Popov, DeepCove Labs <boris <at> deepcovelabs.com> writes:
> > Whats wrong with my examples then? Also, you want it run on load not when you click some button, right? The example does not compile for me (even when I remove the namespace). The example doe snot solve the requirement of complete dynamic separation of action that jQuery is capable of. Thanks _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Intrader Intrader
html button onClick: ( (html jQuery expression: '#externallinks a')
call: 'click' with: ('return alert("your an ass " + this.href)' asFunction)) On Thu, Feb 3, 2011 at 8:28 PM, Fritz Schenk <[hidden email]> wrote: the following JavaScript: -- http://john-mckeon.us _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Thanks John, unfortunately your code also suffers from the same problem
<requirement> <button onClick="$('#external_links a').click(function() { return confirm('You are going to visit: ' + this.href); });" type="submit" class="submit">Attach Click</button> "The confirm returns true or false controlling the action of the anchor. Very simple to say this in JavaScript. See http://jsbin.com/imuka5/2" </requirement> Not so simple in Seaside as we need to work around the double quotes that the onClick message uses. <generated Seaside source> <button onclick="$("#external_links a").click(function(){return confirm ("Your are going to visit: " + this.href)})" type="submit" class="submit">Attach Click</button> </generated Seaside source> See the nested double quotes. By the way, your code generates exactly the same html as <exactly same html as your code> onClick: ((html jQuery expression: 'external_links a') onClick: 'return confirm("You are going to visit: "+ this.href)'); with: 'Attach Click' </exactly same html as your code> Sorry, and thanks again _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Is this some sort of sick sociology experiment on people?
RS
> To: [hidden email] > From: [hidden email] > Date: Sat, 5 Feb 2011 19:42:16 +0000 > Subject: [Seaside] Re: I would like to attach an onClick event according to > > Thanks John, unfortunately your code also suffers from the same problem > <requirement> > <button onClick="$('#external_links a').click(function() { > return confirm('You are going to visit: ' + this.href); > });" type="submit" class="submit">Attach Click</button> > > "The confirm returns true or false controlling the action of the anchor. Very > simple to say this in JavaScript. See http://jsbin.com/imuka5/2" > </requirement> > > Not so simple in Seaside as we need to work around the double quotes that the > onClick message uses. > > > <generated Seaside source> > <button onclick="$("#external_links a").click(function(){return confirm > ("Your are going to visit: " + this.href)})" type="submit" > class="submit">Attach Click</button> > </generated Seaside source> > > See the nested double quotes. > > By the way, your code generates exactly the same html as > <exactly same html as your code> > onClick: ((html jQuery expression: 'external_links a') > onClick: 'return confirm("You are going to visit: "+ this.href)'); > with: 'Attach Click' > </exactly same html as your code> > Sorry, and thanks again > > > > > > _______________________________________________ > 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 |
Robert Sirois <watchlala <at> hotmail.com> writes:
> > > Is this some sort of sick sociology experiment on people? what do you mean? _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
We all seem to be going in circles and good suggestions are being ignored. One can't expect the list to provide literal solutions just as one can't expect every bit JavaScript to be expressible using Lukas' excellent abstraction layer. You can write custom code using JSStream or, more appropriately, in a dedicated file in your library.
Sent from my iPhone On 2011-02-05, at 2:48 PM, "Fritz Schenk" <[hidden email]> wrote: > Robert Sirois <watchlala <at> hotmail.com> writes: > >> >> >> Is this some sort of sick sociology experiment on people? > what do you mean? > > _______________________________________________ > 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 Intrader Intrader
Fritz,
The difference is pointed out below.
On Sat, Feb 5, 2011 at 2:42 PM, Fritz Schenk <[hidden email]> wrote: Thanks John, unfortunately your code also suffers from the same problem I typed it out using alert, substitute confirm and it works as expected.
These have nothing to do with it. I tested what I sent, and it works.... The real reason is below....
Not exactly. Add the # before external_links a and you will get the desired result. It is not about the quotes. John
-- http://john-mckeon.us _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Boris Popov, DeepCove Labs (SNN)
Boris and Robert, and so it seams to you that I am ignoring the suggestions.
I have tried each an every your suggestions and it runs into the problem of the onClick message handler. The example I am after is very basic jQuery that requires the minimal injection of code into your html to solve problems. Thanks for following. I do think that Lukas' layer is an excellent abstraction layer. Sorry, if it makes it very frustrating to try to do jQuery with Seaside and believe that we can 'say it with Seaside' _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by John McKeon
John
> I typed it out using alert, substitute confirm and it works as expected. Please provide me with the working code. Sorry, the generated code is: <generated Seaside source> <button onclick="$("#external_links a").click(function(){alert ("Your are going to visit: " + this.href)})" type="submit"class="submit"> Attach Click</button> </generated Seaside source> See the nested double quotes. his is the source of the problem I am being extremely stubborn about this issue as it show a problem with the onClick message handler in Seaside. The embedded double quote is not correct! _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
renderContentOn: html html div id: 'external_links'; with: [ 1 to: 5 do: [:x |
html anchor callback: [x inspect]; with: x.
html break]. 1 to: 5 do: [:x | html text: 'just some content'. html break.]]. html button
onClick: ((html jQuery expression: '#external_links a') onClick: 'return confirm("You are going to visit: "+ this.href)');
with: 'Fritz''s Attach Click'. html button
onClick: ( (html jQuery expression: '#external_links a') call: 'click' with: ('return confirm("You are going to visit: " + this.href)' asFunction));
with: 'My Attach Click' On Sun, Feb 6, 2011 at 12:09 AM, Fritz Schenk <[hidden email]> wrote: John -- http://john-mckeon.us _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Intrader Intrader
Hey Fritz, I wasn't following all the details of this but... man, don't be shy in hacking the shit that is rendering that in an improper way Just go with the debugger until it renders that and investigate why (the involved code) isn't rendering the thing in the way is expected to be don't underestimate your hacking powers you don't need our permission or anybody's BTW if you find the thing, would be nice if you tell us what you've learned or what you have improved On Feb 6, 2011, at 3:09 AM, Fritz Schenk wrote:
_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by John McKeon
John, thank you for taking the time to recreate the test. It teaches me how to
use Seaside more efficiently. Except for the <break>s it is exactly the http://jsbin.com/imuka5/2 However, neither <myAttach> html button onClick: ((html jQuery expression: '#external_links a') onClick: 'return confirm("You are going to visit: "+ this.href)'); with: 'Fritz''s Attach Click'. /myAttach> or, <yourAttach> html button onClick: ( (html jQuery expression: '#external_links a') call: 'click' with: ('return confirm("You are going to visit: " + this.href)' asFunction)); with: 'My Attach Click' <yourAttach> Work. What the small application incorrectly brings up the inspector in the callback of the anchor without output of the confirm dialog. The reason being that the above two attaches are translated into code with the same problem. The embedded double quotes are the problem. <as per source in halos> <button onclick="$("#external_links a").click(function(){return confirm ("You are going to visit: "+ this.href)})" type="submit" class="submit"> Fritz's Attach Click</button> <button onclick="$("#external_links a").click(function(){return confirm ("You are going to visit: " + this.href)})" type="submit" class="submit"> My Attach Click</button> <as per source in halos> Notice that the onClick:... and call:... messages generate exactly the same code. I have reported this problem. _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by sebastianconcept@gmail.co
Sebastian, thank you. I follow your posting and blog eagerly.
I will try do debug this by placing a 'self halt' before the rendering of the button: 1. I find the x has a value of 6 outside of the block! - interesting 2. At method 'expression:context:' I see that aString:='external_links a' has been changed in the top of the stack to($("external_links a")) - it may be happening while executing [Array with: aString with:anObject]; this happens in the context:constructor: message to jQueryInstance. The method returns a JQueryInstance with the stack top set to ($("external_links a")) - in should be ($('external_Links a')). I will also try the firebug debugger on the generated code. Simply changing the embedded double quotes to single quotes work. I reported a bug blaming it on asFunction - that is incorrect. It is inside of the expression:context: message in the construction of the JQueryInstance. _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Intrader Intrader
On 2/6/11 2:35 PM, Fritz Schenk wrote:
> John, thank you for taking the time to recreate the test. It teaches me how to > use Seaside more efficiently. Except for the<break>s it is exactly the > http://jsbin.com/imuka5/2 > > However, neither > <myAttach> html button > > onClick: ((html jQuery expression: '#external_links a') > onClick: 'return confirm("You are going to visit: "+ this.href)'); > > with: 'Fritz''s Attach Click'. > /myAttach> > or, > <yourAttach> html button > > onClick: ( (html jQuery expression: '#external_links a') > > call: 'click' with: ('return confirm("You are going to visit: " + this.href)' > asFunction)); > > with: 'My Attach Click' > <yourAttach> > > Work. What the small application incorrectly brings up the inspector in the > callback of the anchor without output of the confirm dialog. > The reason being that the above two attaches are translated into code with > the same problem. The embedded double quotes are the problem. > > <as per source in halos> > <button onclick="$("#external_links a").click(function(){return confirm > ("You are going to visit: "+ this.href)})" type="submit" class="submit"> > Fritz's Attach Click</button> > <button onclick="$("#external_links a").click(function(){return confirm > ("You are going to visit: " + this.href)})" type="submit" class="submit"> > My Attach Click</button> > <as per source in halos> > > Notice that the onClick:... and call:... messages generate exactly the same code. > > I have reported this problem. > > > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > Not sure where you are seeing the embedded double quotes, but if I run this code and View Source in my browser (Safari), it looks like Seaside has sent this: <button onclick="$("#external_links a").click(function(){return confirm("You are going to visit: "+ this.href)})" type="submit" class="submit">Fritz's Attach Click</button> <button onclick="$("#external_links a").click(function(){return confirm("You are going to visit: " + this.href)})" type="submit" class="submit">My Attach Click</button> no errors noted in the error console, so I'm not sure where the error is happening for you. Also, (see attached snapshot) when I click on one of the anchors, I see the confirm dialog. If I click Cancel, the dialog goes away and that's it. If I click OK, then the callback is run (thus opening an inspector) after dismissing the dialog. Note sure why this doesn't meet your expectations. Cheers, Bob _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside dialog.png (66K) Download Attachment |
Free forum by Nabble | Edit this page |