History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-3855
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: -- --
Assignee: Mamye Kratt
Reporter: Josh Crowley
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Setting a class's datapath to its parent datapath results in Firebug error and non-working app in DHTML only

Created: 06/Apr/07 01:15 PM   Updated: 17/Jul/07 11:30 AM
Component/s: Laszlo Foundation Classes (LFC)
Affects Version/s: 4.0.0
Fix Version/s: Legals, 4.0.3

Time Tracking:
Not Specified

Environment: OSX, Firefox 2.0

Severity: Major
Fixed in Change#: 5,385
Fixed in branch: branches/legals
Runtime: N/A
Fix in hand: False


 Description  « Hide
I'm working on a new charting/graphing API, and when trying to run it in DHTML, I got the "infinity spinner" and a Firebug error:

$1.indexOf is not a function
initialize(Datapath for barchart name: testchart id: testchart _instanceAttrs=Object __LZisnew=true, Datapath for chartdata __LZdeferDelegates=true _instanceAttrs=Object)LFCdhtml.js (line 7976)
make()LFCdhtml.js (line 235)
parsePath(Datapath for barchart name: testchart id: testchart _instanceAttrs=Object __LZisnew=true)LFCdhtml.js (line 7320)
setXPath(Datapath for barchart name: testchart id: testchart _instanceAttrs=Object __LZisnew=true)LFCdhtml.js (line 7174)
__LZapplyArgs(Object, true)LFCdhtml.js (line 611)
initialize(chartdata _instanceAttrs=Object _instanceChildren=[3], Object, undefined, undefined)LFCdhtml.js (line 420)
make()LFCdhtml.js (line 235)
setDatapath(Datapath for barchart name: testchart id: testchart _instanceAttrs=Object __LZisnew=true)LFCdhtml.js (line 876)
setAttribute("datapath", Datapath for barchart name: testchart id: testchart _instanceAttrs=Object __LZisnew=true)LFCdhtml.js (line 641)
f()newchart.lzx (line 426)
applyConstraint("datapath", function(), [barchart name: testchart id: testchart _instanceAttrs=Object _instanceChildren=[1], "datapath"])LFCdhtml.js (line 837)
__LZresolveRefs(Object)LFCdhtml.js (line 802)
__LZresolveReferences()LFCdhtml.js (line 767)
__LZcallInit()LFCdhtml.js (line 528)
__LZcallInit()LFCdhtml.js (line 540)
__LZcallInit(undefined)LFCdhtml.js (line 5456)
okToInit()LFCdhtml.js (line 5432)
__LZinstantiationDone()LFCdhtml.js (line 5428)
makeSomeViews([], 500)LFCdhtml.js (line 9390)
checkQ()LFCdhtml.js (line 9357)
sendEvent(155)LFCdhtml.js (line 1335)
__idleupdate()LFCdhtml.js (line 10310)
__update()LFCdhtml.js (line 1376)
[Break on this error] var $4=$1.indexOf(":/")

Playing around a little, I discovered this was because I have the following attribute on two custom classes:

datapath="${parent.datapath}"

This works in Flash (and is necessary) for getting all the datapaths to filter down accordingly. Without it, no bars are drawn. But in DHTML, it results in a non-working app.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Josh Crowley - 06/Apr/07 01:15 PM
Assigning to Max.

Josh Crowley - 11/Jun/07 04:52 PM
Running this in DHTML will give the error.

<canvas>
<dataset name="dset">
<example>data</example>
</dataset>

<view datapath="dset:/example">
<view datapath="${parent.datapath}"/>
</view>
</canvas>

Max Carlson - 11/Jun/07 05:32 PM
Updated testcase:

<canvas debug="true">
<dataset name="dset">
<example>data</example>
</dataset>

<view datapath="dset:/example" onclick="Debug.write(this.datapath.serialize())" bgcolor="green" width="100" height="20">
<view x="40" datapath="${parent.datapath}" bgcolor="red" width="100" height="20" onclick="Debug.write(this.datapath.serialize())"/>
</view>

<text y="40">Clicking on the red and green boxes should show the same result in the debugger for swf and dhtml</text>
</canvas>

Max Carlson - 11/Jun/07 06:02 PM
Author: max
Date: 2007-06-11 18:00:29 -0700 (Mon, 11 Jun 2007)
New Revision: 5385

Modified:
   openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs
Log:
Change 20070611-maxcarlson-Y by maxcarlson@plastik on 2007-06-11 17:31:06 PDT
    in /Users/maxcarlson/openlaszlo/legals-clean
    for http://svn.openlaszlo.org/openlaszlo/branches/legals

Summary: Fix for datapath="${parent.datapath}"

New Features:

Bugs Fixed: LPP-3855 - Setting a class's datapath to its parent datapath results in Firebug error and non-working app in DHTML only

Technical Reviewer: jcrowley
QA Reviewer: promanik
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: LzDatapointer.lzs - parsePath() tests to see if path passed in is already a LzDatapath.
    

Tests: See LPP-3855 for testcase. Now passes in dhtml and swf.



Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs 2007-06-12 00:54:39 UTC (rev 5384)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs 2007-06-12 01:00:29 UTC (rev 5385)
@@ -573,6 +573,7 @@
   * @access private
   */
 function parsePath ( pa ){
+ if (pa instanceof LzDatapath) pa = pa.xpath;
     var q = this.ppcache[ pa ];
     if ( q ) {
         var l = q['islocaldata']


_______________________________________________
Laszlo-checkins mailing list
Laszlo-checkins@openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Mamye Kratt - 17/Jul/07 11:30 AM
(4.0 branch (4.0.3RC) local build r5678)
Ran the testcase Max listed in his comments.