WB17 Looper in AJAX mode very slow

Startbeitrag von Arie am 26.07.2013 15:44

I'm have a table control for displaying orders. And a looper next to it, displaying orderlines.
Whenever I click an order, the orderlines are shown in the looper.
The looper filled by code and when I debug this code, the filling of the looper is almost instantly. Then the debugger switched back to IE and the looper is refreshed (redrawn).

But this is very slow. I see the Ajax-hourglass for 10-20 seconds for just 3 or 4 orderlines.
The row-selection event of the table-control (orders) is put in ajax-mode.
The looper control is set to ajax mode.
Everything is running locally on my development machine

I must be missing something, but what?


Additional info.
The looper contains 3 combos, linked to looper-attributes.
These are filled once by code, when the page loads.
When I skip this 'filling' the delay is gone! And the orderlines are shown fast.

So it must be something with the combos in a looper??

von Arie - am 26.07.2013 16:01
Hi Arie

unfortunately (and that is NOT documented), EACH TIME an ajax communication occurs, the init code of the page is RE-executed, which explains your delay, as I'm guessing that not all the data is comeing in one swoop...

To avoid that phenomemon (but be aware that you are then in uncharted territory, and that you should thorougly test the behavior of your page), you can test on the parameters of your page...

Depending on the typf of ajax communication, different parameters are used that you can intercept in order to NOT redo your own code.
This is the code of a function (server) that I'm using for testing on the two most important parameters that I'm aware of, in order to know if the current code (server side) is part of an ajax communication or my regular page init:


bResult is boolean=True

IF PageParameter("WD_ACTION_")="" THEN
IF PageParameter("WD_BUTTON_CLICK_")="" THEN
RESULT bResult

So in your page init code you can do:

If InWxMode()=false then

Hope this helps

von Fabrice Harari - am 26.07.2013 16:12
Hi Fabrice,
I did some track+trace but this is not the case.
One of the combos has several hundreds of records. This is causing most of the delay at some point.
I think I suggest to my client to skip the combo. Having so many items isn't user friendly in the first place.

von Arie - am 26.07.2013 17:34
Hi Arie,
I had the same problem with WinDEV 17 this week ...
The only difference (vs WebDEV) is that it shows up in WinDEV apps with larger DataSets.

After some debugging I found that the problem are the combo boxes.
For every line in my OrderLines the product combobox FILLED ALL my products from the database - and I am talking about 150.000 records !!!

So even in a test enviroment with ONLY one Order and a couple of OrderLines the combination of combos and a LARGE product file was KILLING my app.

I deleted the comboboxes and used another technique and everythings works OK now.
Even tested the same technique with WEBDEV 17 and Ajax and is seems to work also.

I also changed ALL my search tables (for the product file) AND I am now using Fulltext Search instead of the classic WinDEV table.

Steven Sitas

von Steven Sitas - am 27.07.2013 10:42
Steven you are right.
1000+ products times 3 combos per line times several orderlines = much data = bad performance
I skipped the combos as well and replaced them with an editfield for searching.

von Arie - am 27.07.2013 11:42
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.