Henry Minsky wrote:
>
> <canvas width="100%" height="80%" debug="true">
> <debug fontsize="12"/>
> <checkbox id="bar">Hello Whirled</checkbox>
>
> </canvas>
>
>
> Gets error in debugger
>
> ERROR: No eventSender (null) for on_enabled
> lzx> Debug.inspect(«LzError#0| ERROR: No eventSender (null) ...»)
> «LzError#0| ERROR: No eventSender (null) for on_enabled» {
> backtrace: «LzBacktrace(17)#2| LzSourceMessage <- LzError <-
> Function.make <- LzSourceMessage.format <-...»
> file: null
> line: null
> message: «LzMessage#1(36)#3| "No eventSender (null) for on_enabled"»
> }«LzError#0| ERROR: No eventSender (null) for on_enabled»
> lzx> Debug.inspect(«LzBacktrace(17)#2| LzSourceMessage <- Lz...»)
> «LzBacktrace(17)#2| LzSourceMessage <- LzError <- Function.make <-
> LzSourceMessage.format <-...» {
> length: 17
> 0: «__LzStackFrame#8| LzEvent.sendEvent.apply(#LzIdle.onidle, [914])»
> 1: «__LzStackFrame#12| LzInstantiator.checkQ.apply(#LzInstantiator,
> [914])»
> 2: «__LzStackFrame#15| LzInstantiator.makeSomeViews.apply
> (#LzInstantiator, [, 500])»
> 3: «__LzStackFrame#20|
> LzCanvas.__LZinstantiationDone.apply(«LzCanvas#18#17| This is the
> canvas», [])»
> 4: «__LzStackFrame#23| LzCanvas.okToInit.apply(«LzCanvas#18#17| This
> is the canvas», [])»
> 5: «__LzStackFrame#26| LzCanvas.__LZcallInit.apply(«LzCanvas#18#17|
> This is the canvas», [])»
> 6: «__LzStackFrame#30| LzNode.__LZcallInit.apply(#bar, [])»
> 7: «__LzStackFrame#33| LzNode.__LZresolveReferences.apply(#bar, [])»
> 8: «__LzStackFrame#36| LzNode.__LZresolveRefs.apply(#bar, [[object
> Object]])»
> 9: «__LzStackFrame#39| LzNode.applyConstraint.apply(#bar, [_enabled,
> [type Function], checkbox id: bar ,enabled,checkbox id: bar
> ,_parentcomponent,null,_enabled])»
> 10: «__LzStackFrame#43| LzDelegate.register.apply(#bar.$cf0(), [null,
> on_enabled])»
> 11: «__LzStackFrame#47| Debug.error.apply(#Debug, [No eventSender (%w)
> for %s, null, on_enabled])»
> 12: «__LzStackFrame#50| Debug.warnInternal.apply(#Debug, [[type
> Function], No eventSender (%w) for %s, null, on_enabled])»
> 13: «__LzStackFrame#54| LzSourceMessage.format.apply(LzError, [null,
> null, No eventSender (%w) for %s, null, on_enabled])»
> 14: «__LzStackFrame#57| Function.make.apply(LzError, [null, null, No
> eventSender (null) for on_enabled])»
> 15: «__LzStackFrame#59| LzError.apply(«LzError#0| ERROR: No eventSender
> (null) for on_enabled», [null, null, No eventSender (null) for
> on_enabled])»
> 16: «__LzStackFrame#62| LzSourceMessage.apply(«LzError#0| ERROR: No
> eventSender (null) for on_enabled», [null, null, No eventSender (null)
> for on_enabled])»
> }«LzBacktrace(17)#2| LzSourceMessage <- LzError <- Function.make <-
> LzSourceMessage.format <-...»
> lzx>
>
>
>
> In basecomponent.lzx, there is this declaration
>
> <event name="on_enabled"/>
>
>
> The code in the compiler NodeModel.java emits a "$immediately{null}" as
> the init value for a "event" attribute. I am wondering
> if it should be initialized to the same sentinel object that
> DeclareEvent uses ?
>
>
> void addPropertyElement(Element element) {
> String tagName = element.getName();
> if (tagName.equals("method")) {
> addMethodElement(element);
> } else if (tagName.equals("handler")) {
> addHandlerElement(element);
> } else if (tagName.equals("event")) {
> // needed to prevent interpretation as an event handler for
> // schema-defined events -- setting the value to immediate
> // null is enough to do that
> // TODO: [2006-01-29 ptw] This mechanism is a little
> // fragile: right now ${} trumps any type, which is why this
> // works; but that could easily break if we enforce
> // types...
> element.setAttribute("value", "$immediately{null}");
> addAttributeElement(element);
> } else if (tagName.equals("attribute")) {
> addAttributeElement(element);
> }
> }
>
Sounds like it should definitely be initialized to the sentinel array...
--
Regards,
Max Carlson
OpenLaszlo.org
_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev