Accueil → WEBDEV 24 → Totals in a looper
Totals in a looper
Débuté par Mimmo Ghiara, 22 mai 2020 11:51 - 1 réponse
Posté le 22 mai 2020 - 11:51
I have a problem with a looper's totals
The lopper is Ajax, it is loaded by code. I add the lines I need with a Looper.Add (.....) then I insert the values, save the record in the database with an AJAXExecute and then I run the totals, the problem is that the looper.count () function returns me one line less than the ones displayed and the last one is missing. In this case it gives me the wrong totals.
I also tried heder and footer but I can't use them for space reasons
Any suggestions
Posté le 27 mai 2020 - 10:07
Hi everyone,

I answer myself hoping that the indications will serve others, even if I think it is a bug or something that does not work properly.
I was trying to totalize some fields in a looper and I discovered that the row of the looper on which the object is positioned, theoretically does not exist yet. If you try to debug, you find that the Lopper_myloop. [Row] .EDT_grammi object does not exist or returns empty even if you have just entered a value and if you exit the object and check how many lines the looper has, they are always one less than those displayed.
If instead you put a "Calculate" button at the foot, but outside the looper and inside you calculate the toatli, pressing the button the same looper returns you the displayed rows and totals correctly
If I have to make an invoice what do I do: vmmit a calculate button? Absurd
Thanks, I hope that the gentlemen of PC Soft will also read it