[Laszlo-dev] Fwd: [JIRA] Commented: (LPP-8524) TypeError in init() method of basetree when showroot is set to false

Henry Minsky hminsky at laszlosystems.com
Fri Nov 6 13:21:12 PST 2009


Hey Max,

There's an error in IE7 when the sprite tries to set the bgcolor of a div to
be a value that looks like a combination of a hex value plus a float, for
example
#f9f9f93700.00014

This  value is coming from the swatchview setting a bgcolor which has an
alpha
value (e..g., rgb.0a format decimal)

Is that weird hybrid hex/decimal format actually a supported color CSS spec,
or does it just happen to work in Firefox. IE7 will not accept it. Do you
know what the right way to handle this case is (alpha with bgcolor)?

---------- Forwarded message ----------
From: "Henry Minsky" <hminsky at laszlosystems.com> (JIRA) <
jira at laszlosystems.com>
Date: Fri, Nov 6, 2009 at 12:28 PM
Subject: [JIRA] Commented: (LPP-8524) TypeError in init() method of basetree
when showroot is set to false
To: hminsky at laszlosystems.com



   [
http://jira.openlaszlo.org/jira/browse/LPP-8524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54373#action_54373]

Henry Minsky commented on LPP-8524:
-----------------------------------

The error is happening because a color is being passed in to setbgcolor
which is a floating point number, and LzColorUtils.inttohex turns that into
a bogus string. Now, to figure out where that is coming from...


> TypeError in init() method of basetree when showroot is set to false
> --------------------------------------------------------------------
>
>                 Key: LPP-8524
>                 URL: http://jira.openlaszlo.org/jira/browse/LPP-8524
>             Project: OpenLaszlo
>          Issue Type: Bug
>          Components: Components - tree
>    Affects Versions: 4.6
>            Reporter: Abraham
>            Assignee: Henry Minsky
>            Priority: P0
>             Fix For: 4.7 (TRUNK)
>
>         Attachments: script_error.jpg
>
>
> Description:
> Client encountered the following problem. Happens only when compiling our
application to swf9. Below is the simplified  program to
> reproduce the problem.To bypass the problem showroot has been set to true.
They would like this to be fixed in the next release given to them.
>
---------------------------------------------------------------------------------------------
> Sample program to show the error in basetree when showroot="false":
>             <canvas height="500" debug="true">
>               <include href="base/basetree.lzx"/>
>
>               <class name="echotree" extends="basetree" showroot="false">
>
>                 <method name="init">
>      Debug.debug ("echotree - init(): this=", this, ", this.children=",
> this.children, ", this.children.subviews=", this.children.subviews);
>                 super.init();
>         </method>
>
>                 <view placement="item" layout="axis: x; spacing: 2"
>                       bgcolor="${classroot.selected
>                                 ? classroot.style.selectedcolor
>                                 : classroot.parent.bgcolor}">
>                   <handler name="onclick">
>                     classroot.changeFocus();
>                     if (! classroot.isleaf) {
>                       classroot.setAttribute("open", ! classroot.open);
>      }
>                   </handler>
>                   <text text="${classroot.text}" resize="true" />
>                   <text text="${classroot.text}" resize="true" />
>                 </view>
>               </class>
>
>               <view x="20" y="20" layout="axis: x; spacing: 10">
>                 <echotree>paragraph
>                 </echotree>
>               </view>
>             </canvas>
> -------------------------------------------------------------------------
> Debug statement showed that this.children.subviews is an empty array in
> debug console:
> DEBUG: echotree - init(): this= «<echotree>#0| /view/echotree» ,
> this.children= «<view>#2#1| /view/echotree/@children» ,
> this.children.subviews= «Array(0)#3| []»
>
>
---------------------------------------------------------------------------
> Error got when showroot="false":
> TypeError: Error #1010: A term is undefined and has no properties.
>         at
> $lzc$class_basetree/init()[C:\Temp\lzswf9\work\Laszlo\build\tree\$lzc$
class_basetree.as:49]
>         at
> $lzc$class_echotree/init()[C:\Temp\lzswf9\work\Laszlo\build\tree\$lzc$
class_echotree.as:8]
>         at LzNode/__LZcallInit()[/tmp/lzswf9/lzgen24517/LzNode.as:504]
>         at LzNode/__LZcallInit()[/tmp/lzswf9/lzgen24517/LzNode.as:479]
>         at LzCanvas/__LZcallInit()[/tmp/lzswf9/lzgen24517/LzCanvas.as:461]
>         at
> LzCanvas/__LZinstantiationDone()[/tmp/lzswf9/lzgen24517/LzCanvas.as:410]
>         at
>
LzInstantiatorService/makeSomeViews()[/tmp/lzswf9/lzgen24517/LzInstantiatorService.as:234]
>         at
>
LzInstantiatorService/checkQ()[/tmp/lzswf9/lzgen24517/LzInstantiatorService.as:171]
>         at Function/http://adobe.com/AS3/2006/builtin::call()<http://adobe.com/AS3/2006/builtin::call%28%29>
>         at LzEvent/sendEvent()[/tmp/lzswf9/lzgen24517/LzEvent.as:89]
>         at
> LzIdleKernel$/__update()[/tmp/lzswf9/lzgen24517/LzIdleKernel.as:19]
> Note: This is complaining about (sv[0]) is undefined because sv is an
> empty array.
>
-------------------------------------------------------------------------------
> in init() method of basetree.lz:
>                     var sv = this.children.subviews;
>                     if (sv && (sv[0])  instanceof lz.basetree) {
>                         focusItem = sv[0].item;
>                     }
> Note: the example failed because sv is not undefined but it is an empty
> array.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.openlaszlo.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira





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


More information about the Laszlo-dev mailing list