<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;">Hello,</div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;">I would like to combine the use of onChange: and onKeyPress: to display 'Save' &amp; 'Cancel' buttons.</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;">onChange: is useful when a value is pasted in to the text field, and onKeyPress: shows the buttons without having to click elsewhere.&nbsp;<span style="font-size: 10pt;">So far this is working well, except when the first component selected after entering text is the 'Save' or 'Cancel' button.&nbsp;</span><span style="font-size: 10pt;">When that happens, the onChange: action is triggered, which re-renders the button. From the
 user's perspective, the button press was ignored and needs to be done again.</span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span style="font-size: 10pt;"><br></span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span style="font-size: 10pt;">I would like to have the onKeyPress: action remove the onChange: behaviour. &nbsp;How can that be done?</span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span style="font-size: 10pt;">Or is there a better way to detect that text was pasted in? (i.e. cases where onKeyPress: is not triggered).</span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);
 background-color: transparent; font-style: normal;"><span style="font-size: 10pt;"><br></span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;">Here is some sample code...&nbsp;</div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span style="background-color: transparent;">If you enter a value into the text input field and then press the button, you'll notice the ignored button press.</span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;">renderContentOn: html</div><div style="font-family: arial,
 helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br></div><div style="background-color: transparent;"><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space: pre;">        </span>html form: [</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>html text: 'Message text:'.</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>html textInput</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                        </span>value: self messageText;&nbsp;</font></div><div style="background-color:
 transparent;"><font face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                        </span>onChange: (html jQuery ajax callback: [:inputValue | self messageText: inputValue] value: html jQuery this value);</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                        </span>onChange: ((html jQuery id: 'showThis') load html: [:renderer | self renderMessageTextAndButtonOn: renderer]);</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                        </span>onKeyPress: (html jQuery ajax callback: [:inputValue | self messageText: inputValue] value: html jQuery this value);</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span"
 style="white-space:pre">                        </span>onKeyPress: ((html jQuery id: 'showThis') load html: [:renderer | self renderMessageTextAndButtonOn: renderer]);</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                        </span>yourself.</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>html horizontalRule.</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span>html div id: 'showThis'; with: [</font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space: pre;">                        </span>self renderMessageTextAndButtonOn: html]]</font></div><div
 style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2">renderMessageTextAndButtonOn: html<br></font></div><div style="background-color: transparent;"><font face="arial, helvetica, sans-serif" size="2"><div style="background-color: transparent;"><br></div><div style="background-color: transparent;"><span class="Apple-tab-span" style="white-space:pre">        </span>html button callback: [Transcript cr; show:
 'Button pressed']; with: 'Press'.</div><div style="background-color: transparent;"><span class="Apple-tab-span" style="white-space:pre">        </span>html break.</div><div style="background-color: transparent;"><span class="Apple-tab-span" style="white-space: pre;">        </span>html text: self messageText asString</div></font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif"
 size="2">Thanks,&nbsp;</font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2">Bob Nemec</font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font face="arial, helvetica, sans-serif" size="2">HTS Engineering</font></div></div></div></body></html>