[Seaside] jQuery variable check for onBlur

Gastón Dall' Oglio gaston.dalloglio at gmail.com
Wed Apr 10 18:56:27 UTC 2013


Hello Joachim.

I agree completly with all you say, just some remarks:
* ?: is conditional *operator* and not conditional *statement* (sorry for
this remark, but for clarification purpose it is important).
* you change to the JSIfThenElse class fix the problem to have conditional
statement with a false part, but with this change there is no longer
conditional operator (which is really useful to use in expressions). I
think it would be better to add the factory methods missing to JSObject
(like #conditional:else: and #conditional:elseif:), and the respective
decorations classes if nedded.

Regards.

2013/4/10 jtuchel at objektfabrik.de <jtuchel at objektfabrik.de>

> Gaston,
>
> Am 10.04.13 17:11, schrieb Gastón Dall' Oglio:
>
>  Hello all.
>>
>> I guess that Seaside developers only wrap js construction that was needed
>> to give support to another pieces of Seaside (like ajax, jQuery...), and
>> they are not thinking in to give really support to construct complex js
>> code in with Smalltalk objects. For that reason those js wrappers are
>> incomplete and no correctly correlated to js language.
>>
> Well, they are indeed incomplete, but cover quite some area. But I agree
> that sometimes the API to construct javascript statements feels strange.
> That is why I sometimes prefer to write a jQueryPlugin and integrate it
> with a subclass of JQPlugin on the Smalltalk side. Works quite well so far.
>
>  For example, for conditional statements exists only JSCondition that to
>> evaluate only for true case, neither "If...else" nor "If...else if...else"
>> (JSIfThenElse wrap the conditional operator not conditional statement).
>>
> Hmm. I wasn't aware of the differences between an if/then/else statement
> and the conditional statement. For me that was just the same thing with a
> shorter (and idiotic, but C-like) syntax. So the fix I suggest(ed) turns a
> JSIfThenElse form a conditional statement into an If..then...else
> statement. Not sure where there might be problems. Maybe if somebody uses
> JsIfThenElse on the right side of an assignment in JS. For my purposes, it
> does a good job.
>
>>
>> Recently I made an Seaside app and often I had to make js sentences using
>> "JSStream on:", no good :(. I've also seen other programmers code which did
>> the same, in Reef IIRC. Maybe to use amber for that to be better...
>>
>> Below some inline comments:
>>
>> 2013/4/10 jtuchel at objektfabrik.de <mailto:jtuchel at objektfabrik.de> <
>> jtuchel at objektfabrik.de <mailto:jtuchel at objektfabrik.de>>
>>
>>
>>
>>      There's always something new to learn in Seaside and its
>>     Javascript integration.
>>
>>
>> Yes it's really true!
>>
>>     Please remember my fix if you need to have more than one
>>     javascript statement executed (concatednated with a , on the
>>     Smalltalk side) in either the true or false branch.
>>
>>     But maybe the fix isn't needed if you put those into a JavaScript
>>     block. I never tried and never had the idea before until right now
>>     as I type this.
>>     I don't even know if
>>
>>     (a==b) ? {callA(); callB()} : {callC(); callD()};
>>
>>
>> In conditional operator, you have to use "," instead to ";" to separate
>> sentences within brackets. Seaside to use an ";" to render js when
>> concatenate sentences, so you have a problem here :(
>>
> So my fix is perfect. Because it completely eliminates the conditional
> statement and nobody has to worry about that (once again, very technical)
> difference.
>
> Or am I missing something?
>
> Joachim
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20130410/1b650526/attachment-0001.htm


More information about the seaside mailing list