Issue with TTMSFNCTreeView

Not sure whether this should be posted in the FNC group, but it's using it within WebCore that issue arrises. 


I might be doing something wrong here, but I get the following error when using  TTMSFNCTreeView. This happens when I try to open a branch that isn't the last branch of the tree

WEBLib.TMSFNCTypes.pas:305 Uncaught TypeError: Cannot read property 'Left' of undefined
    at Object.$assign (WEBLib.TMSFNCTypes.pas:305)
    at Object.t.$clone (rtl.js:407)
    at Object.DrawDisplay (WEBLib.TMSFNCCustomTreeView.pas:5872)
    at Object.DrawNodes (WEBLib.TMSFNCCustomTreeView.pas:5907)
    at Object.Draw (WEBLib.TMSFNCCustomTreeView.pas:6772)
    at Object.DrawControl (WEBLib.TMSFNCCustomControl.pas:2150)
    at Object.Paint (WEBLib.TMSFNCCustomControl.pas:2191)
    at Object.Invalidate (WEBLib.Controls.pas:3700)
    at Object.UpdateChildren (WEBLib.Controls.pas:3261)
    at Object.UpdateParent (WEBLib.Controls.pas:3518)
$assign @ WEBLib.TMSFNCTypes.pas:305
t.$clone @ rtl.js:407
DrawDisplay @ WEBLib.TMSFNCCustomTreeView.pas:5872
DrawNodes @ WEBLib.TMSFNCCustomTreeView.pas:5907
Draw @ WEBLib.TMSFNCCustomTreeView.pas:6772
DrawControl @ WEBLib.TMSFNCCustomControl.pas:2150
Paint @ WEBLib.TMSFNCCustomControl.pas:2191
Invalidate @ WEBLib.Controls.pas:3700
UpdateChildren @ WEBLib.Controls.pas:3261
UpdateParent @ WEBLib.Controls.pas:3518
SetParent @ WEBLib.Controls.pas:2873
UpdateScrollBars @ WEBLib.TMSFNCTreeViewBase.pas:1282
UpdateNodesCache @ WEBLib.TMSFNCCustomTreeView.pas:7092
UpdateTreeView @ WEBLib.TMSFNCTreeViewBase.pas:1195
ExpandNodeInternal @ WEBLib.TMSFNCTreeViewData.pas:3425
ToggleNodeInternal @ WEBLib.TMSFNCTreeViewData.pas:3197
HandleNodeToggle @ WEBLib.TMSFNCCustomTreeView.pas:7952
HandleMouseUp @ WEBLib.TMSFNCCustomTreeView.pas:5014
MouseUp @ WEBLib.TMSFNCCustomControl.pas:1462
HandleDoMouseUp @ WEBLib.Controls.pas:2520
cb @ rtl.js:217
9WEBLib.TMSFNCTypes.pas:305 Uncaught TypeError: Cannot read property 'Left' of undefined
    at Object.$assign (WEBLib.TMSFNCTypes.pas:305)
    at Object.XYToCacheItem (WEBLib.TMSFNCCustomTreeView.pas:7256)
    at Object.HandleMouseMove (WEBLib.TMSFNCCustomTreeView.pas:4763)
    at Object.MouseMove (WEBLib.TMSFNCCustomControl.pas:1453)
    at Object.HandleDoMouseMove (WEBLib.Controls.pas:2755)
    at HTMLSpanElement.cb (rtl.js:217)
$assign @ WEBLib.TMSFNCTypes.pas:305
XYToCacheItem @ WEBLib.TMSFNCCustomTreeView.pas:7256
HandleMouseMove @ WEBLib.TMSFNCCustomTreeView.pas:4763
MouseMove @ WEBLib.TMSFNCCustomControl.pas:1453
HandleDoMouseMove @ WEBLib.Controls.pas:2755
cb @ rtl.js:217
WEBLib.TMSFNCTypes.pas:305 Uncaught TypeError: Cannot read property 'Left' of undefined
    at Object.$assign (WEBLib.TMSFNCTypes.pas:305)
    at Object.t.$clone (rtl.js:407)
    at Object.DrawDisplay (WEBLib.TMSFNCCustomTreeView.pas:5872)
    at Object.DrawNodes (WEBLib.TMSFNCCustomTreeView.pas:5907)
    at Object.Draw (WEBLib.TMSFNCCustomTreeView.pas:6772)
    at Object.DrawControl (WEBLib.TMSFNCCustomControl.pas:2150)
    at Object.Paint (WEBLib.TMSFNCCustomControl.pas:2191)
    at Object.Invalidate (WEBLib.Controls.pas:3700)
    at Object.DoExit (WEBLib.TMSFNCCustomTreeView.pas:3275)
    at Object.HandleDoExit (WEBLib.Controls.pas:2856)

The code generating the tree is:

  procedure DrawArray(Value: JS.TJSArray; ParentNode: TTMSFNCTreeViewNode);
  var lData: JS.TJSArray;
      lObj: JS.TJSObject;
      lVal: JSValue;      //TJSObjectDynArray
      lNode: TTMSFNCTreeViewNode;
      lStatus: Char;
  begin
    for lVal in Value do
    begin
      //lObj :=  JS.toObject(Value);
      lObj := JS.toObject(lVal);

      lStatus := JS.toString(lObj.Properties['itemstatus'])[1];
      lNode := MenuTree.AddNode(ParentNode);
      lNode.Text[0] := JS.toString(lObj.Properties['pagename']);
      lNode.Text[1] := PageStatusText(lStatus);
      lNode.Text[3] := JS.toString(lObj.Properties['itemurn']);

      lData := JS.toArray(lObj.Properties['subpages']);
      DrawArray(lData, lNode);

    end;
  end;

Bit missed off the bottom of the trace:


$assign @ WEBLib.TMSFNCTypes.pas:305
t.$clone @ rtl.js:407
DrawDisplay @ WEBLib.TMSFNCCustomTreeView.pas:5872
DrawNodes @ WEBLib.TMSFNCCustomTreeView.pas:5907
Draw @ WEBLib.TMSFNCCustomTreeView.pas:6772
DrawControl @ WEBLib.TMSFNCCustomControl.pas:2150
Paint @ WEBLib.TMSFNCCustomControl.pas:2191
Invalidate @ WEBLib.Controls.pas:3700
DoExit @ WEBLib.TMSFNCCustomTreeView.pas:3275
HandleDoExit @ WEBLib.Controls.pas:2856
cb @ rtl.js:217

Is this with the latest version of TMS WEB Core & TMS FNC UI Pack?

I have retested this here with a default TTMSFNCTreeView on the form and cannot see an issue when expanding / collapsing any nodes.

It's with the latest FNC UI pack and the new Beta release of webcore

What exact steps to follow starting with a default TTMSFNCTreeView on a new TMS WEB Core web application to reproduce?

I have created a simple application and if you open any branch (by clicking on the [+] ) other than the bottom one then that exception is raised. I'll send the app using the support form. 

Thanks, we received it & will follow-up.

I'm not sue if this is the same issue.


I have a TWebPanel aligned left and one aligned client, separated by a splitter. I have the treeview on the left aligned panel and aligned to client.

When I drag the splitter right (making the tree wider) all seems fine. After widening the panel and then dragging the splitter left the following exception occurs immediately:

ERROR
Uncaught TypeError: Cannot read property 'Left' of undefined | TypeError: Cannot read property 'Left' of undefined at Object.$assign (http://localhost:8000/LiveBase_WebCore/LiveBase_WebCore.js:46192:21) at Object.t.$clone (http://localhost:8000/LiveBase_WebCore/LiveBase_WebCore.js:412:48) at Object.DrawDisplay (http://localhost:8000/LiveBase_WebCore/LiveBase_WebCore.js:69682:68) at Object.DrawNodes (http://localhost:8000/LiveBase_WebCore/LiveBase_WebCore.js:69638:12) at Object.Draw (http://localhost:8000/LiveBase_WebCore/LiveBase_WebCore.js:71642:12) at Object.DrawControl (http://localhost:8000/LiveBase_WebCore/LiveBase_WebCore.js:58764:16) at Object.Paint (http://localhost:8000/LiveBase_WebCore/LiveBase_WebCore.js:59005:12) at Object.Invalidate (http://localhost:8000/LiveBase_WebCore/LiveBase_WebCore.js:14796:12) at Object.UpdateChildren (http://localhost:8000/LiveBase_WebCore/LiveBase_WebCore.js:13463:48) at Object.UpdateParent (http://localhost:8000/LiveBase_WebCore/LiveBase_WebCore.js:13441:12)

I could not reproduce this.
Test project

http://www.tmssoftware.net/public/treeview_webpanel.zip 

The initial issue (the exception raised when expanding nodes other than the bottom one) is fixed as far as I can tell by the latest FNC UI release and the first Beta of WebCore 1.2.


I have upgraded to the latest WebCore Beta and the second issue is still present - when you reduce the size of the panel that the the tree is on with a splitter, the exception reported above still occurs. I have sent the test project for this to you a few days ago.

Thanks 

Hi,


We were able to reproduce the issue, but haven't found a workaround yet. We'll keep you updated on this issue as soon as possible.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.