[Laszlo-user] Changes coming in OpenLaszlo 4.1 (aka RingDing)

P T Withington ptw at pobox.com
Thu Mar 20 05:30:15 PDT 2008


If you are using OpenLaszlo Trunk, or expecting to upgrade to  
OpenLaszlo 4.1 when it is released, you should be aware of the  
following changes coming your way:

+ The syntax <method event="eventname"> is now deprecated and will  
trigger a compiler warning. You should update your code to use  
<handler name="eventname">. In the case where the method is named  
(<method event="eventname" name="methodname">) you will have to split  
the declaration into a handler (<handler name="eventname"  
method="methodname" />) and a method (<method name="methodname">).  
[This syntax allows subclasses to override the method that will be  
handling the event. See the documentation for `handler` for further  
details and examples.]

+ In previous versions of LZX, you could potentially create a  
duplicate attribute with no warning from the compiler. For example:

<class name="zot">
   <attribute name="name" value="${'bar'}" />
</class>

In the above example, the attribute named `name` is defined both in  
the open tag of the class and as an attribute. This is illegal and  
could lead to ambiguous or unpredictable results. The compiler will  
now warn that you have a duplicated attribute. You will have to rename  
one of the duplicate cases to ensure that your code works as expected.

+ Classes defined using the <class name="name"> _must_ be referenced  
in script as `lz.name`, there will no longer be a global alias `name`  
that refers to the class implementing the tag.

+ The classes that represent LZX-defined classes now have an internal  
name. If you want to know the name of the tag that defined an object,  
you should ask
`<object>.constructor.tagname`, not `<object>.constructor.classname`.

+ `getAttribute` is deprecated. You should just reference the  
attribute directly. getters are no longer supported.

---

You can prepare for the above changes by updating your code now, since  
the forward-compatible techniques are all already supported in 4.0.

---

The following change should not affect user code:

+ Initial values, initial expressions ($once, $path, $style, and  
$always), now are created as a unified list in the tag compiler  
solving several issues with overriding/inheritance of attribute values  
and constraints and enabling the solution to an issue with states and  
constraints. As a result, if you override `LzNode#construct`, and  
attempt to manipulate the `args` list, you must be aware that some  
values in that list will be `LzInitExpr`s and cannot be directly  
inspected. These value represent consraints that will be applied by  
LzNode#__LZapplyArgs.

If you _do_ have classes that override `construct` _and_ expect to  
manipulate the args to that method, you will have to update your code  
when moving to 4.1.  You can prepare for this by testing your code  
against trunk.



More information about the Laszlo-user mailing list