<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Its quite clear using the sendEvent method, like you illustrate, and although i like One Way to Do things, it reads right! So on that score carry on. On another angle, what if i get a name from a server source and the name is the same, but other values are different, and because of that other operations don't occur? I think it's a iffy move. If you do change it, it's certainly not the end of the world.<div><div><div><div><div><br></div><div>.j</div><div><br><div><div><div>On Apr 25, 2009, at 7:21 PM, Henry Minsky wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br>It seems to me that in your example, you really want to send an event, and setting the attribute is one step removed from that. So maybe the most<div>clear way to implement that would be to call sendEvent directly</div> <div><br></div><div><br></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-size: 26px; "><div class="gmail_quote"><div><span class="Apple-style-span" style="font-size: small;"><method name="update"></span></div> <div><span class="Apple-style-span" style="font-size: small;"> canvas.onupdate.sendEvent( true);</span></div></div><span class="Apple-style-span" style="font-size: small;"></method></span></span><span class="Apple-style-span" style="font-size: small;"><br> </span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-size: 37px;"><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-size: 53px;"><br></span></div> <div><br></div><div><br><div class="gmail_quote">On Sat, Apr 25, 2009 at 6:46 PM, jamesr <span dir="ltr"><<a href="mailto:circlecycle@gmail.com">circlecycle@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> <br><br><div class="gmail_quote"><div><div></div><div class="h5">On Fri, Apr 17, 2009 at 6:36 PM, P T Withington <span dir="ltr"><<a href="mailto:ptw@pobox.com" target="_blank">ptw@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> I'm working on <a href="http://jira.openlaszlo.org/jira/browse/LPP-8058" target="_blank">http://jira.openlaszlo.org/jira/browse/LPP-8058</a> to reduce the number of extraneous events sent by implementing the following optimization:<br> <br> If an attribute is constrained, and the values the constraint depends on change, but the result of the constraint does _not_ change, then the attribute will not be updated (to the identical value) and, more importantly, no `on` event will be sent. The change can be demonstrated by considering the following:<br> <br> <canvas layout="axis: x; spacing: 5" debug="true"><br> <attribute name="jay" value="2" /><br> <handler name="onjay">Debug.info("onjay")</handler><br> <attribute name="kay" value="4" /><br> <handler name="onkay">Debug.info("onkay")</handler><br> <attribute name="jaykay" value="${jay*kay}" /><br> <handler name="onjaykay"><br> Debug.info("onjaykay: %d * %d = %d", jay, kay, jaykay);<br> </handler><br> <button onclick="canvas.setAttribute('jay', canvas.jay)">Same</button><br> <button onclick="canvas.setAttribute('jay', canvas.jay + 1)">Different</button><br> </canvas><br> <br> In the current system, setting `jay` will _always_ cause `jaykay` to be updated, and for there to be an `onjaykay` event. In the proposed change, setting `jay` to the same value, will cause an `onjay` event, but the constraint on `jaykay` will have the same result, so `jaykay` will _not_ be updated and there will be _no_ `onjaykay` event sent.<br> <br> Comments? Questions?<br></blockquote><div><br></div></div></div><div>I use handlers to fire functionality without actually changing any values. An example would be</div><div><br></div><div><canvas></div><div> <attribute name="update" type="boolean" value="false"/></div> <div> <...></div><div> <handler name="onupdate" reference="canvas"></div><div> //do something</div><div> </handler> </div><div> </...></div><div><canvas></div> <div><br></div><div><method name="update"></div><div> canvas.setAttribute('update', true);</div></div></method><div><br></div><div>where i expect the update handlers to get run on true regardless of whether they were already true before. This change would require that i set update to false after such an event. In my own runtime, i include a "touch" method which allows me to fire an event without having to set an explicit value, just for these type of delegate networks. I would toss in my two cents by saying that it would be nice to have one or the other available to me. </div> <div><br></div><div>there might be other methods to accomplish the same thing - i'm just pointing out a pattern that my code depends on, currently</div><div><br></div><div>-james</div> </blockquote></div><br><br clear="all"><br>-- <br>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br><br><br> </div></blockquote></div><br></div></div></div></div></div></div></body></html>