Hi, i wrote a code to build a ColinTreeListview following 3 step :
1- Get datas ('n' times in a loop = Nbr_Report) trough Firebase and store the result in a list
2- Display the list in ColinTreeListview
3- Add new data in this ColinTreeListView in the specific field "ExtraButtonTextr"
See Blocks code following
The strange issue is : I need to click twice on Btn_Load, like if i need to launch twice the routine to get the correct result :
The fist click, nothing is displayed, the second, perfect, all is displayed ?!
Could someone explain me why or how to get the result in one pass ?
Many Thks
I'm not familiar with ColinTreeListView, so I'll assume for now that there's something wrong with the Button.Click method. Could you please introduce a label, and then set its text to global flag and global Nbr_Report's values, and then take a screenshot of you running it? I suspect that something might be happening in the while loop.
Hi, Thks for your reply.
I've introduced 3 labels to monitor what's happend :
Label2 is the number of elements to get from firebase. It's initialized to 7.
Label3 is the counter for the loop and is incremented each time we read a record
Label4 is filled when the second proc is done (step 3)
New blocks :
Screenshoot before click :
Screenshoot after the 1st click :
And final screenshoot after a 2nd click to the button
I don't understand why i need to click a second time to get the list displayed ?
Thks
Probably because you call the Chg_Total procedure AFTER you set the CTListview. One your first click you just get the Set, on your second click you will get the set and the Chg_Total.
Try setting the CTListview after running the Chg_Total procedure
Hi TIM,
If i call Chg_Total before to set the list, after my first click i got the same screenshoot as above (With 7,8 and no text in label 4) and nothing else.
Then, after the second click i got :
Hi, i also tried to exit the call Chg_Total and just finish by the Call ColinTreeListView
The result is same as the 3 screenshoot above, except that in the last screen shoot there is no value in the gray area (extrabutton) which is normal because there is no call to Chg_Total.
But the program still need to be click 2 times to get the list displayed....
I'm stuck
I tried to move the display code into the firebase.gotdataevent and ... it's ok
But the call Chg_total procedure don't now fill the values in the extra_button ...
and when i had a label to check List_Total befor to call Chg_Total, i got and empty field ?
Yet i build the variable List_Total into the firebase got.event ...
Hi, fuzzy ...
Hum,
-1-
In the ColinTreeListView we only can display 1 Picture and 2 Texts Elements
But i was needing another Field (in my cas to report the Total).
Then I decided to use the Extrabutton Text for store the total. (So just an item by line)
-2-
After each new datum arrives. I Built a procedure to store all Total, i did'nt find another solution before.
-3-
Regarding your last advice i move the last display into the firebase event and it seems that now it's run correctly !
Difficult for me to understand this way to run and these subtilities ...
In my past when i was calling a subfunction, the operation just after the call was executed only then the call was finished.
But OK, Now it's perfect, great thks to you and to all reader for their contribution !
Final Screen Shoot