PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 2024
→
Looper Initialisation
Looper Initialisation
Started by SolutionJ-Reg, Jun., 27 2017 3:01 PM - 6 replies
Connect yourself…
SolutionJ-Reg
#1
Posted on June, 27 2017 - 3:01 PM
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
Report
0
0
Fabrice Harari
#2
Posted on June, 27 2017 - 3:11 PM
Hi
sure... looperaddline, by example
Best regards
Report
0
0
SolutionJ-Reg
#3
Posted on June, 27 2017 - 3:39 PM
Looperaddline yes, but by using what source data? I can't use any HFSQL commands or constructs, that is the problem...
Report
0
0
Fabrice Harari
#4
Posted on June, 27 2017 - 8:00 PM
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
Report
0
0
SolutionJ-Reg
#5
Posted on June, 27 2017 - 8:10 PM
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?
Report
0
0
Piet van Zanten
#6
Posted on June, 27 2017 - 9:37 PM
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
Report
0
0
SolutionJ-Reg
#7
Posted on June, 27 2017 - 11:01 PM
Hi Piet,
Thanks for this, it's perfect!
Cheers
Reg
Report
0
0
→ Go back to WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text