TIWTreeView - please help

<< Click to Display Table of Contents >>

Navigation:  Forum >

TIWTreeView - please help

Forum link

 

Pages: 1 2

 


 

04-24-2019, 05:12 PM:

 

W7/64 C++ Builder XE7 (update 1) 32-bit build New IntraWeb Application

 

Latest IW (.20) brand new license and support update, carefully installed in virgin W7 / XE7 re-installation, unbundle tool used prior to upgrade.

 

Please see my earlier post just a few back for more info.

 

I am left with the original TreeView problem - nothing about it seems to work.  This is the code in its entirety...

 

 

 

static TIWTreeViewItem *tnp, *snp;

 

void __fastcall TIWForm1::IWButton2AsyncClick(TObject *Sender, TStringList *EventParams)

 

///////////////////////////////////////////////////////////////////////////////////////

 

{

 

    tnp = LogTreeView->Items->Add( NULL );

 

    tnp->Caption = "First Node";

 

    snp = LogTreeView->Items->Add( tnp );

 

    snp->Caption = "First Sub Node";

 

    tnp->Expanded = false;

 

}

 

void __fastcall TIWForm1::LogTreeViewTreeItemClick(TObject *Sender, TIWTreeViewItem *ATreeViewItem)

 

//////////////////////////////////////////////////////////////////////////////////////////////////

 

{

 

String us = ATreeViewItem->Caption;

 

us = us;

 

}

 

Just as before, the TV displays expanded with the + and - ineffective, and (double) clicking on one or t'other fails to fire the Click event.  I have tried setting AsyncMode (default True) to both T and F, and setting DoServerSidePlusMinus (default True) set both T and F.  I added the following code with no success:

 

void __fastcall TIWForm1::LogTreeViewPlusMinus(TObject *aSender, bool aIsPlus)

 

/////////////////////////////////////////////////////////////////////////////

 

{

 

    tnp->Expanded = aIsPlus;

 

}

 

Please, what have I missed ?

 

Denville.

 


 

04-26-2019, 10:10 AM:

 

Hi Denville,

 

we have a comprehensive demo showing how to use IWTreeView (in both Sync and Async modes). It is written in Delphi but writing similar code in C++ should be straightforward.

 

Does it work for you?

 

https://github.com/Atozed/IntraWeb/tree/...eeViewDemo

 


 

04-27-2019, 05:01 PM:

 

Unfortunately I cannot compile the demo as I don't have Delphi.

 

I have ploughed through the code and as far as I can see the simplest operation boils down to what I illustrated above, ie (combining the caption with the Add):-

 

    tnp = LogTreeView->Items->Add( NULL, "First Node" );

 

    snp = LogTreeView->Items->Add( tnp, "First Sub Node" );

 

    LogTreeView->Items->Add( NULL, "Second Node" );

 

It remains completely non-functional (can't contract node, can't get TreeItemClick to fire).  I put a button on the form to make sure it wasn't general, the button works fine.

 


 

05-06-2019, 07:55 AM:

 

(04-27-2019, 05:01 PM)denville Wrote: [ -> ]Unfortunately I cannot compile the demo as I don't have Delphi.

 

I have ploughed through the code and as far as I can see the simplest operation boils down to what I illustrated above, ie (combining the caption with the Add):-

 

    tnp = LogTreeView->Items->Add( NULL, "First Node" );

 

    snp = LogTreeView->Items->Add( tnp, "First Sub Node" );

 

    LogTreeView->Items->Add( NULL, "Second Node" );

 

It remains completely non-functional (can't contract node, can't get TreeItemClick to fire).  I put a button on the form to make sure it wasn't general, the button works fine.

 

Can you please try this minimal test case C++ application and tell me what you get?

 


 

05-09-2019, 08:15 AM:

 

Hi Alexandre...

 

Whilst I don't have Delphi I was able to incorporate the MainForm.pas from the demo into a clean IW project, replacing the default Form1 with MainForm.pas.  The application then compiled without error and the the application ran - and behold, the TreeView behaved perfectly (ie the demo was completely successful).  So I then scoured the .pas code to see if I could determine where I was going wrong - but couldn't find anything to help.

 

Then, in an act of desperation, I deleted the TIWTreeView component from MainForm.pas and replaced it with same dropped from my component pallette.  I assigned the two events to those in the original pas and ran the application.  This time, the tree view failed to work properly with exactly the same symptoms I have previously described (permanent expansion, unable to collapse, etc.).

 

I compared the .pas, .dfm, and .hpp files before and after the change and could find nothing of significance, just a few extra properties in my version and some font and colour properties I hadn't copied.

 

So I am at a loss to understand what is happening here - why is the TIWTreeView fine when in the original .pas, but useless when I replace it (still in the .pas) with the one from the installed components.  And if they are different, where on earth is it finding (and know to find) a different component, since it is only identified by (identical) name in the .dfm and .pas files ?

 

OS: W7/64 : IW 15.0.20 : C++ Builder version XE7 : 32-bit platform.

 

Denville.

 

PS I think you asked me to try the three-line minimal test case. Yes, I have tried that exhaustively !

 

D.

 


 

05-09-2019, 10:50 AM:

 

You tried it and??? I believe it worked, right?

 

So, can you create a non working minimal test case and send it to me so I can try to identify what is going on?

 


 

05-11-2019, 01:00 PM:

 

Minimal app attached:

 

W7/64

 

C++ Builder XE7

 

IntraWeb 15.0.20

 

32-bit platform

 

Denville.

 


 

06-08-2019, 10:32 AM:

 

I am back from leave and still struggling with this.  I have some more intelligence..

 

To recap, I can build the example in C++ Builder and it works as expected.  But if I deleted the TIWTreeView and replaced it with same from my component palette (adding the same event handlers) then it was non-functional.  I examined the difference between the text version of the example form and that of my non-functional version and the IWTV properties look substantially the same (see below)...

 

But I found that if I copied the TV properties in their entirety from the example to my page, the TV started working again.  I checked each item individually and they were the same except (and I had unfortunately discounted this)...

 

WHAT MAKES THE DIFFERENCE is that the example has a couple of TreeNodes added at the design stage, thus present in the text, whereas my page did not.  Sure enough, I proved that this was the difference between functionality and failure.  To prove the point, I took my non-functioning page without any pre-defined nodes, added a minimal node (HELLO) in the designer and - bingo, the TV now works.

 

I remain uncertain what is going on here, and short of adding an arbitrary node in the designer that does nothing, I can't quite see how to navigate around the problem where all the nodes are added dynamically.

 

Please...

 

Denville.

 


 

06-09-2019, 01:57 AM:

 

Hi Denville,

 

I'm testing your application. I'll have some more info soon.

 


 

06-09-2019, 03:10 AM:

 

Hum... I finally found the issue.

 

You are trying to create it from an Async event. Please update your IW to this new build we have just released:

 

http://downloads.atozed.com/intraweb/iw15.0.22.exe

 

After updating, please also set your TreeView.AsyncMode to true.

 

Please let me know if it worked.

 

Cheers