[Laszlo-dev] For Review: 20081001-laszlo-a Summary: SWWF8/9 and DHTML: Survey: "Bad Vacation Choice: Trenton" dialog only works the first time

P T Withington ptw at pobox.com
Thu Oct 2 03:38:44 PDT 2008


On 2008-10-02, at 02:30EDT, J Crowley wrote:

> Details: Ontext event doesn't get called if
>   the text is set to the same value as what
>   was already present.  (Is this a bug, or
>   is it desired behavior?  If it's a bug,
>   I'll file it, but I've noticed this for
>   some time now and just thought it was
>   expected.)

Darn good question.

I'm sure this behavior is the result of an (over) optimization.  I  
seem to recall there is some optimization to ignore duplicate sets,  
probably because the font/size computations that entail, and that  
there is a special over-ride flag to say 'no, seriously, I want to re- 
do the set', because if you have changed the font, even though the  
text is the same, you need the whole computation.

The question here is:  should setting an attribute always cause the  
corresponding event (even if the value is not changing)?

My vote is yes.

Pro:
   It's a simple, consistent rule
   It is the system default for any attribute that does _not_ have a  
custom setter
   Listener's may depend on the action, not the value

Con:
   Inefficient if the listener depends only on the value

---

We have at least on bug report touching on this area already:

http://jira.openlaszlo.org/jira/browse/LPP-3002

And one of our most popular recurring bugs is custom setters that  
forget to send the event:

http://jira.openlaszlo.org/jira/browse/LPP-2273

The current system makes it too easy to write a custom setter an  
forget to send the corresponding event.  I would be in favor of  
changing the default so that you have to do something extra to write a  
setter that handles the sending of the event itself.  Simple  
proposal:  setter in the open tag always sends the event, setter using  
the <setter> tag has an option to request handling sending of the  
event itself.




More information about the Laszlo-dev mailing list