FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
Looper Initialisation
Looper Initialisation
Débuté par SolutionJ-Reg, 27 juin 2017 15:01 - 6 réponses
Connectez-vous…
SolutionJ-Reg
#1
Posté le 27 juin 2017 - 15: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
Signaler
0
0
Fabrice Harari
#2
Posté le 27 juin 2017 - 15:11
Hi
sure... looperaddline, by example
Best regards
Signaler
0
0
SolutionJ-Reg
#3
Posté le 27 juin 2017 - 15:39
Looperaddline yes, but by using what source data? I can't use any HFSQL commands or constructs, that is the problem...
Signaler
0
0
Fabrice Harari
#4
Posté le 27 juin 2017 - 20:00
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
Signaler
0
0
SolutionJ-Reg
#5
Posté le 27 juin 2017 - 20:10
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?
Signaler
0
0
Piet van Zanten
#6
Posté le 27 juin 2017 - 21:37
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
Signaler
0
0
SolutionJ-Reg
#7
Posté le 27 juin 2017 - 23:01
Hi Piet,
Thanks for this, it's perfect!
Cheers
Reg
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte