Thank you, Max.
<br/>I learned how to pass a value from one callback to another.
<br/>Sabine
<br/><br/>On Thu, Jul 11, 2013 at 8:26 AM, Max Leske [via Smalltalk]
<br/>&lt;<a href="/user/SendEmail.jtp?type=node&node=4698351&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>&gt; wrote:
<div class='shrinkable-quote'><br/>&gt; Sorry about my first answer. I was at work and wanted to do this quickly.
<br/>&gt; I've posted all the relevant code below.
<br/>&gt;
<br/>&gt; For clarification: this is from Seaside 2.8, the script is Scriptaculous /
<br/>&gt; Prototype (SUObject and subclasses).
<br/>&gt;
<br/>&gt; &quot;aBlock&quot; (as you can see now in the code below) is the secondary callback [
<br/>&gt; :value | self customOrderCount: value asNumberOrZero ]. You can specify
<br/>&gt; multiple secondary callback, but only one primary callback (the primary
<br/>&gt; callback being #callback:, the secondary #callback:value:). The second
<br/>&gt; argument to #callback:value: is a script that will be evaluated on the
<br/>&gt; client side when the event is triggered. The value is then passed into the
<br/>&gt; (secondary) callback block. The primary callback will be evaluated only
<br/>&gt; after all secondary callbacks have been evaluated.
<br/>&gt; The flow is thus the following:
<br/>&gt; 1. get the value of the text input (&quot;(html formElement id: id) value&quot;)
<br/>&gt; 2. write that value to a variable (secondary callback)
<br/>&gt; 3. update the content of a &lt;div&gt; according to the changed value (primary
<br/>&gt; callback)
<br/>&gt;
<br/>&gt; &quot;id&quot; is the id of the text input, in this case 'custom-order-amount'.
<br/>&gt; #updateSideContainerOn: simply creates a script that updates a &lt;div&gt; with
<br/>&gt; new information.
<br/>&gt;
<br/>&gt; renderCustomOrderCountBasicOn: html
<br/>&gt; html textInput
<br/>&gt; id: 'custom-order-amount';
<br/>&gt; onKeyUp: (self customOrderCountChangedOn: html).
<br/>&gt; html text: 'Ex.'
<br/>&gt;
<br/>&gt;
<br/>&gt; customOrderCountChangedOn: html
<br/>&gt; ^ self
<br/>&gt; get: 'custom-order-amount'
<br/>&gt; doAndUpdate: [ :value | self customOrderCount: value asNumberOrZero ]
<br/>&gt; on: html
<br/>&gt;
<br/>&gt;
<br/>&gt; get: id doAndUpdate: aBlock on: html
<br/>&gt; ^ (html evaluator
<br/>&gt; callback: [ :script | self updateSideContainerOn: script ];
<br/>&gt; callback: aBlock
<br/>&gt; value: (html formElement id: id) value;
<br/>&gt; yourself) asString
<br/>&gt;
<br/>&gt;
<br/>&gt; updateSideContainerOn: script
<br/>&gt; script add: (script canvas updater
<br/>&gt; id: 'side-container';
<br/>&gt; callback: [ :ajaxHtml | self renderPageRightOn: ajaxHtml ];
<br/>&gt; yourself)
<br/>&gt;
<br/>&gt;
<br/>&gt; Cheers,
<br/>&gt; Max
<br/>&gt;
<br/>&gt;
<br/>&gt; On 10.07.2013, at 11:26, Sabine Knöfel &lt;[hidden email]&gt; wrote:
<br/>&gt;
<br/>&gt; Hi Max,
<br/>&gt;
<br/>&gt; thanks. 3 questions:
<br/>&gt; 1) what is in aBlock?
<br/>&gt; 2) is id the id of the textInput?
<br/>&gt; 3) can you send (the relevant part) of updateSideContainerOn?
<br/>&gt;
<br/>&gt; Sabine
<br/>&gt;
<br/>&gt; On Wed, Jul 10, 2013 at 11:04 AM, Max Leske [via Smalltalk]
<br/>&gt; &lt;&lt;a
<br/>&gt; href=&quot;x-msg://2268/user/SendEmail.jtp?type=node&amp;amp;node=4698123&amp;amp;i=0&quot;
<br/>&gt; target=&quot;_top&quot; rel=&quot;nofollow&quot; link=&quot;external&quot;&gt;[hidden email]&gt; wrote:
<br/>&gt;
<br/>&gt;&gt; Hi Sabine
<br/>&gt;&gt;
<br/>&gt;&gt; We use some similar code. I simply copied it from our productive
<br/>&gt;&gt; environment, so you'll have to figure out the details for yourself :)
<br/>&gt;&gt; #customOrderCountChangedOn: basicly answers the script I pasted second.
<br/>&gt;&gt;
<br/>&gt;&gt; html textInput
<br/>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; id: 'custom-order-amount';
<br/>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onKeyUp: (self customOrderCountChangedOn: html).
<br/>&gt;&gt;
<br/>&gt;&gt; (html evaluator
<br/>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; callback: [ :script | self updateSideContainerOn: script
<br/>&gt;&gt; ];
<br/>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; callback: aBlock
<br/>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value: (html formElement id: id) value;
<br/>&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yourself) asString
<br/>&gt;&gt;
<br/>&gt;&gt; HTH (ask again if you're having troubles),
<br/>&gt;&gt; Max
<br/>&gt;&gt;
<br/>&gt;&gt; On 10.07.2013, at 10:35, Sabine Knöfel &lt;[hidden email]&gt; wrote:
<br/>&gt;&gt;
<br/>&gt;&gt;&gt; Hi,
<br/>&gt;&gt;&gt;
<br/>&gt;&gt;&gt; in a &quot;register new user&quot; page, I have a textInput where I want to check
<br/>&gt;&gt;&gt; the
<br/>&gt;&gt;&gt; validity of an email address each time the user types in one character.
<br/>&gt;&gt;&gt; If
<br/>&gt;&gt;&gt; the email adress is valid, the &quot;register&quot; button should enable.
<br/>&gt;&gt;&gt;
<br/>&gt;&gt;&gt; How would you do this? Does anybody have a text snippet for me?
<br/>&gt;&gt;&gt;
<br/>&gt;&gt;&gt; html textInput
<br/>&gt;&gt;&gt; ....
<br/>&gt;&gt;&gt; onKeyUp: ????
<br/>&gt;&gt;&gt;
<br/>&gt;&gt;&gt; Sabine
<br/>&gt;&gt;&gt;
<br/>&gt;&gt;&gt;
<br/>&gt;&gt;&gt;
<br/>&gt;&gt;&gt; --
<br/>&gt;&gt;&gt; View this message in context:
<br/>&gt;&gt;&gt; <a href="http://forum.world.st/onKeyUp-do-check-and-enable-button-tp4698098.html" target="_top" rel="nofollow" link="external">http://forum.world.st/onKeyUp-do-check-and-enable-button-tp4698098.html</a><br/>&gt;&gt;&gt; Sent from the Seaside General mailing list archive at Nabble.com.
<br/>&gt;&gt;&gt; _______________________________________________
<br/>&gt;&gt;&gt; seaside mailing list
<br/>&gt;&gt;&gt; [hidden email]
<br/>&gt;&gt;&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_top" rel="nofollow" link="external">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br/>&gt;&gt;
<br/>&gt;&gt; _______________________________________________
<br/>&gt;&gt; seaside mailing list
<br/>&gt;&gt; [hidden email]
<br/>&gt;&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_top" rel="nofollow" link="external">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br/>&gt;&gt;
<br/>&gt;&gt;
<br/>&gt;&gt; ________________________________
<br/>&gt;&gt; If you reply to this email, your message will be added to the discussion
<br/>&gt;&gt; below:
<br/>&gt;&gt;
<br/>&gt;&gt; <a href="http://forum.world.st/onKeyUp-do-check-and-enable-button-tp4698098p4698113.html" target="_top" rel="nofollow" link="external">http://forum.world.st/onKeyUp-do-check-and-enable-button-tp4698098p4698113.html</a><br/>&gt;&gt; To unsubscribe from onKeyUp: -&gt; do check and enable button, click here.
<br/>&gt;&gt; NAML
<br/>&gt;
<br/>&gt; ________________________________
<br/>&gt; View this message in context: Re: onKeyUp: -&gt; do check and enable button
<br/>&gt;
<br/>&gt; Sent from the Seaside General mailing list archive at Nabble.com.
<br/>&gt; _______________________________________________
<br/>&gt; seaside mailing list
<br/>&gt; [hidden email]
<br/>&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_top" rel="nofollow" link="external">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br/>&gt;
<br/>&gt;
<br/>&gt;
<br/>&gt; _______________________________________________
<br/>&gt; seaside mailing list
<br/>&gt; [hidden email]
<br/>&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_top" rel="nofollow" link="external">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br/>&gt;
<br/>&gt;
<br/>&gt; ________________________________
<br/>&gt; If you reply to this email, your message will be added to the discussion
<br/>&gt; below:
<br/>&gt; <a href="http://forum.world.st/onKeyUp-do-check-and-enable-button-tp4698098p4698303.html" target="_top" rel="nofollow" link="external">http://forum.world.st/onKeyUp-do-check-and-enable-button-tp4698098p4698303.html</a><br/>&gt; To unsubscribe from onKeyUp: -&gt; do check and enable button, click here.
<br/>&gt; NAML
<br/></div>

        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://forum.world.st/onKeyUp-do-check-and-enable-button-tp4698098p4698351.html">Re: onKeyUp: -&gt; do check and enable button</a><br/>
Sent from the <a href="http://forum.world.st/Seaside-General-f86180.html">Seaside General mailing list archive</a> at Nabble.com.<br/>