<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;">Excellent, it worked great...&nbsp;</div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><br></div><div style="background-color: transparent;"><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal; background-color: transparent;"><font size="2"><span class="Apple-tab-span" style="white-space: pre;">                </span>onSuccess: (</font></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal; background-color: transparent;"><font size="2"><span class="Apple-tab-span" style="white-space:pre">                </span> &nbsp; &nbsp;(Javascript.JSStream on: 'saveCancelButtonClicked == 0') then: (</font></div><div style="color: rgb(0, 0, 0); font-family:
 arial, helvetica, sans-serif; font-size: 13px; font-style: normal; background-color: transparent;"><font size="2"><span class="Apple-tab-span" style="white-space:pre">                                </span>(html jQuery id: 'portalSelectedComponent') load html: [:renderer |&nbsp;</font></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal;">...the method that renders the save and cancel buttons contains...</div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal;"><span class="Apple-tab-span" style="font-size: 13px; background-color: transparent; white-space: pre;">        </span><span style="font-size: small;
 background-color: transparent;">html script: 'saveCancelButtonClicked = 0;' .</span><br></div><div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal;"><span style="font-size: 13px; background-color: transparent;">...both the save and cancel buttons implement...</span><br></div><div><font size="2"><span class="Apple-tab-span" style="white-space:pre">        </span>onMouseDown: 'saveCancelButtonClicked = 1;';&nbsp;<br></font></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal;">...works just as I wanted: pressing either the 'Save' or 'Cancel' button after updating an input field triggers the callback on the first click.&nbsp;</div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif;
 font-size: 13px; font-style: normal;">And losing focus triggers the input field onBlur action normally.&nbsp;</div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal;">Thanks,</div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal;">Bob</div></div></div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br></span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> <hr
 size="1">  <b><span style="font-weight:bold;">From:</span></b> "jtuchel@objektfabrik.de" &lt;jtuchel@objektfabrik.de&gt;<br> <b><span style="font-weight: bold;">To:</span></b> seaside@lists.squeakfoundation.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, April 10, 2013 9:21:52 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Seaside] jQuery variable check for onBlur<br> </font> </div> <br>Hi again,<br><br>without having tested it, this may look something like<br><br>onSuccess: (<br>&nbsp; &nbsp;  (JSStream on: 'saveCancelButtonClicked == 1')<br>&nbsp; &nbsp; &nbsp;  then: ((html jQuery id:&nbsp; 'selectedComponent')&nbsp; load html: <br>[:renderer|&nbsp; self&nbsp; renderSelectedComponentOn:&nbsp; renderer]))<br>&nbsp; &nbsp; &nbsp;  else: ....)<br><br>Please let us know how the code ends up looking once you solved. I'd be <br>very interested to learn more about this.<br><br>Joachim<br><br><br>Am 10.04.13
 15:09, schrieb <a ymailto="mailto:jtuchel@objektfabrik.de" href="mailto:jtuchel@objektfabrik.de">jtuchel@objektfabrik.de</a>:<br>&gt; Hi Bob,<br>&gt;<br>&gt; I guess what you are looking for is JSIfThenElse. I have no example at <br>&gt; hand, but remember two things about it:<br>&gt; * It feels strange to send then:else: to a JSObject. Not very <br>&gt; Smalltalkish.<br>&gt; * It does have a bug that I reported on this list a long time ago. It <br>&gt; only renders the (if) ? then : else; form. So you should change <br>&gt; #javascripContentOn: to<br>&gt;<br>&gt; javascriptContentOn: aStream<br>&gt;&nbsp; &nbsp;  aStream nextPutAll: 'if('.<br>&gt;&nbsp; &nbsp;  super javascriptContentOn: aStream.<br>&gt;&nbsp; &nbsp;  aStream nextPutAll: ') {'.<br>&gt;&nbsp; &nbsp;  aStream javascript: self trueStatement.<br>&gt;&nbsp; &nbsp;  aStream nextPutAll: '} else {'.<br>&gt;&nbsp; &nbsp;  aStream javascript: self falseStatement.<br>&gt;&nbsp; &nbsp;  aStream
 nextPut: $}.<br>&gt;<br>&gt; for more complex statements.<br>&gt;<br>&gt; In your case, what you need to do first is produce a JSObject that <br>&gt; represents the results of the client-side check <br>&gt; "saveCancelButtonClicked == 1" and send it #then: or #then:else. I'd <br>&gt; be interested in how you can create that JSObject... I guess it's <br>&gt; easy....<br>&gt;<br>&gt; Joachim<br>&gt;<br>&gt;<br>&gt; Am 10.04.13 14:59, schrieb <a ymailto="mailto:bobn@rogers.com" href="mailto:bobn@rogers.com">bobn@rogers.com</a>:<br>&gt;&gt; I posted this on Stack Overflow... no answer so far:<br>&gt;&gt; How do I code a variable check into a Seaside jQuery onSuccess: script?<br>&gt;&gt; I have an application with input fields that trigger a value change <br>&gt;&gt; followed by a re-rendering of the view. It works nicely to provide <br>&gt;&gt; lively feedback of domain data based on displayed values.<br>&gt;&gt; The view shows 'Save' and 'Cancel' buttons
 if there are changes <br>&gt;&gt; pending. If the user clicks on either button right after an input <br>&gt;&gt; field, the onBlur: script of the input fields prevents the button <br>&gt;&gt; action from taking place. The recommended solution (button click <br>&gt;&gt; event lost due to the alert box in text box onblur event <br>&gt;&gt; &lt;<a href="http://stackoverflow.com/questions/3245350/button-click-event-lost-due-to-the-alert-box-in-text-box-onblur-event" target="_blank">http://stackoverflow.com/questions/3245350/button-click-event-lost-due-to-the-alert-box-in-text-box-onblur-event</a>&gt;) <br>&gt;&gt; is to use the button's 'onmousedown' event to set a global variable <br>&gt;&gt; that the onBlur script checks.<br>&gt;&gt; With my test code I can see the global 'saveCancelButtonClicked' <br>&gt;&gt; being set, but I don't know how to check the value in order to <br>&gt;&gt; prevent the rendering step.<br>&gt;&gt; |html button<br>&gt;&gt;&nbsp;
 &nbsp; onMouseDown:&nbsp; 'saveCancelButtonClicked = 1;';&nbsp; &nbsp;  ...<br>&gt;&gt;<br>&gt;&gt; html textInput<br>&gt;&gt;&nbsp;  onBlur:&nbsp; ((<br>&gt;&gt;&nbsp; &nbsp; html jQuery ajax<br>&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; callback:&nbsp; [:stringValue|&nbsp; self&nbsp; checkValue: stringValue]&nbsp; <br>&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value:&nbsp; html jQuerythis&nbsp; value)<br>&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; onSuccess:&nbsp; (<br>&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (html jQuery id:&nbsp; 'selectedComponent')&nbsp; load html: <br>&gt;&gt; [:renderer|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  renderer script: <br>&gt;&gt; 'console.log(saveCancelButtonClicked);'.<br>&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self&nbsp; renderSelectedComponentOn:&nbsp; renderer])&nbsp; )]|<br>&gt;&gt; I can see the console.log showing '1' if the save button is pressed. <br>&gt;&gt; So how do I check the value and skip the
 'self <br>&gt;&gt; renderSelectedComponentOn:' step?<br>&gt;&gt; It's easy enough to do in javascript (trivial if statement), but I <br>&gt;&gt; have not found an example in Seaside.<br>&gt;&gt; Thanks for any help,<br>&gt;&gt; Bob Nemec<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; _______________________________________________<br>&gt;&gt; seaside mailing list<br>&gt;&gt; <a ymailto="mailto:seaside@lists.squeakfoundation.org" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>&gt;&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>&gt;<br>&gt; _______________________________________________<br>&gt; seaside mailing list<br>&gt; <a ymailto="mailto:seaside@lists.squeakfoundation.org" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>&gt; <a
 href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>&gt;<br><br>_______________________________________________<br>seaside mailing list<br><a ymailto="mailto:seaside@lists.squeakfoundation.org" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br><br><br> </div> </div>  </div></body></html>