[Laszlo-dev] fix for LPP-4289 "LzDataElementTrait#valueToElement(..)" must be a static-method

Henry Minsky henry.minsky at gmail.com
Fri Jul 20 09:10:22 PDT 2007


There's a bug filed (LPP-4289) about how
lzDataElement.valueToElementdoesn't work in legals,
because it needs to be a static method.

The method is actually defined in the mixin lzDataElementTrait, and if I
declare it static, it doesn't magically
appear visible as LzDataElement.valueToElement. My solution so far looks
like this, which declares it again
in LzDataElement. Is there a better way to do this?



trait LzDataElementTrait {

static function valueToElement ( o ) {
    var n = new LzDataElement("element", { },
LzDataElementTrait.__LZv2E(o));
    return n;
}

static function __LZv2E ( o ) { ... }

}


class LzDataElement extends LzMiniNode inherits LzDataElementTrait,
LzDataNode {
...
...
static var valueToElement = LzDataElementTrait.valueToElement;
}

-- 
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20070720/f4a700df/attachment.html


More information about the Laszlo-dev mailing list