Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Event NodeChange in infinite loop

 Post Reply Post Reply
Author
Arnaldo Caliari View Drop Down
New Member
New Member
Avatar

Joined: 04 Jul 2017
Posts: 22
Post Options Post Options   Quote Arnaldo Caliari Quote  Post ReplyReply Direct Link To This Post Topic: Event NodeChange in infinite loop
    Posted: 16 Jul 2017 at 10:36pm
Hi,

i know, sorry, i'm annoying... i don't know if it's a bug, i'm describing this for your knowledge.

I'm referring to this procedure :

procedure TTMSFMXCloudTMSTreeViewAdapter.SetTreeView(const Value: TTMSFMXTreeView);
begin
  FTMSTreeView := Value;
  if Assigned(FTMSTreeView) then
  begin
    FTMSTreeView.BeginUpdate;
    FOriginalOnChange := FTMSTreeView.OnAfterSelectNode;
    FTMSTreeView.OnAfterSelectNode := NodeChange;
    UpdateColumns;
    ClearTreeView;
    FTMSTreeView.EndUpdate;
  end;
end;

The first time i assign (at runtime) a treeview to the adapter, like

        myadp.TreeView := TreeView1;

the NodeChange procedure is set as the event for OnAfterSelectNode. If at some point i assign another time the treeview, the NodeChange goes also to the FOriginalOnChange private property, and so, after that, when i select an item of the treeview, the NodeChange calls himself in a loop (at the end of NodeChange there is the code

  if Assigned(FOriginalOnChange) then
    FOriginalOnChange(Sender, ANode);

To make it works, i have to

    TreeView1.OnAfterSelectNode := nil;

prior to

        myadp.TreeView := TreeView1;

Kind regards

Arnaldo

Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2081
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 17 Jul 2017 at 9:13am
Hi,

Thank you for notifying.
This issue has been fixed and the update will be available with the next release of the TMS FMX Cloud Pack.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down