Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 1 Monat, 3 Wochen
Letzter Beitrag:
vor 1 Monat, 3 Wochen
Beteiligte Autoren:
SolutionJ-Reg, Fabrice Harari, Piet van Zanten

Looper Initialisation

Startbeitrag von SolutionJ-Reg am 27.06.2017 13:01

WB20

Hi, is there a way to load a Browser type Looper using code? Every type of statement I try and use gives an error because it can only be used in server side processes.

Cheers
Reg

Antworten:

Hi

sure... looperaddline, by example

Best regards

von Fabrice Harari - am 27.06.2017 13:11
Looperaddline yes, but by using what source data? I can't use any HFSQL commands or constructs, that is the problem...

von SolutionJ-Reg - am 27.06.2017 13:39
okay

so your problem has NOTHING to do with loopers.

The question is: how to access DB records from browser code?

In that case, the answer is: there are several ways to do that, depending of your need. The most obvious is to call a server procedure with an ajaxexecute and parse the result to add in the looper.

Best regards

von Fabrice Harari - am 27.06.2017 18:00
I take your point Fabrice, poor phrasing of my actual problem.

I do know how to access DB records from browser code, but I'm still stuck. Basaically in the server procedure that I call with ajaxexecute I parse the resulting data into an array based on a structure, however when I then try to "fill" the looper, which it seems I have to do in browser code, the array containing the data is not available because it was created in a server procedure.

So I suppose my actual specific question is, when I have retrieved my DB data, where do I store it so that it is then available in a browser-side process for use with the looperaddline statement?

von SolutionJ-Reg - am 27.06.2017 18:10
Hi Reg,

The way I use is:
- Create a server procedure and allow it to be Ajax.
- In the procedure you gather the looperdata into a string variable like:
for all qry_SoAndSo 
sContent+=[RC]+qry_SoAndSo.Item1+TAB+qry_SoAndSo.Item2 .. etc
end
RESULT sContent


Then you use a browser procedure to AjaxExecute the server procedure and fill the looper from the string:
sContent=AjaxExecute(MyServerProcedure)
for each string sLine of sContent separated by RC
LooperAddLine(LOOP_Looper1,sLine)
end


Kind regards,
Piet

von Piet van Zanten - am 27.06.2017 19:37
Hi Piet,

Thanks for this, it's perfect!

Cheers
Reg

von SolutionJ-Reg - am 27.06.2017 21:01
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.