UIZE JavaScript Framework

2008 NEWS 2008-11-16 - IMPROVED MODULE: Uize

A number of small improvements have been made to the Uize base class.

1. Uize.toString

The toString intrinsic method is now implemented also as a static method on Uize subclasses, so the alert statement can now be used to display a summary of info for an object that is a reference to a Uize subclass. For example, the statement alert (Uize.Widget.Page) would produce an output like...

[class Uize.Widget.Page]

built : true
busy : inherit
busyInherited : false
confirmDialog : [object Object]
container : undefined
enabled : inherit
enabledInherited : true
html : undefined
idPrefix : page
idPrefixConstruction : undefined
insertionMode : undefined
localized : undefined
name : undefined
nodeMap : undefined
wired : false

This new behavior is similar to the existing behavior for instances of a Uize subclass, excepting that the summary of values for state properties is for the class (i.e. static) rather than an instance.

2. Uize.valueOf

Less compelling than the new Uize.toString static implementation, the valueOf intrinsic method is now also implemented as a static method on Uize subclasses.

This change is more for parity than anything else. This means that you can access the static value of a class' value state property by involving the class reference in an expression, such as +Uize.Widget.Bar.Slider, or Uize.Widgets.RgbSliders.Widget + ''.

3. Name Property Optional in State Property Profiles

When registering state properties using the Uize.registerProperties static method, it is now possible to omit the public name for a property and it will default to the private name.

This may be useful in certain special cases, as outlined in more detail in the State Properties guide (see the section on Public Name Defaulting, which talks about Naked State Properties and Private State Properties).

4. New Variation of set Method

A new variation of the set method that accepts the two parameters propertyNameSTR and propertyValueANYTYPE allows us to use an expression or the value of a variable for specifying the name of the property to set.

This variation is supported for both static and instance calls of this method.


var propertyToSetObj = {};
propertyToSetObj [propertyName] = propertyValue;
myInstance.set (propertyToSetObj);


myInstance.set (propertyName,propertyValue);