FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
How to pass parameters to an Internal Windows (WD)?
How to pass parameters to an Internal Windows (WD)?
Débuté par Steven Sitas, 25 juil. 2014 17:42 - 6 réponses
Connectez-vous…
Steven Sitas
#1
Posté le 25 juillet 2014 - 17:42
Hi,
I have a "host Window" that contains one (or more) internal windoww.
I need to pass some parameters/info to the internal window, when I open/call the host window.
Any Ideas?
Steven Sitas
Signaler
0
0
Alexandre Leclerc
#2
Posté le 25 juillet 2014 - 18:01
Hi Steven,
Explained here, section "Passing parameters to an internal window": <a class="ExternalLink" rel="nofollow" target="_blank" href="http://doc.windev.com/en-US/?1013259">http://doc.windev.com/en-US/…</a>
Best regards,
Alexandre Leclerc
Signaler
0
0
Steven Sitas
#3
Posté le 25 juillet 2014 - 18:15
Hi Alexandre,
the problem with the technique described in the above section, is the following:
1) I have code in the host window - say in the initialization section - where I call IW_MyInternalWin.Init(Param1, Param2)
2) I have ALSO code in the INITIALIZATION of the Internal Window.
The code in the initialization of the Internal Window (No 2) fires up BEFORE I call IW_MyInternalWin.Init(Param1, Param2) - in the host !!!!
Is there a way to run code (1) before code (2) ?
I have been using Global Variables to pass the parameters to the IW, but since I had some free time I am trying to see what other options I have ...
Steven Sitas
Signaler
0
0
steve erts
#4
Posté le 25 juillet 2014 - 18:34
Hi Steven,
In my internal windows I just declare global variables in the Global Declarations section of the window and then update them from the main window by a direct reference any time I need them updated.
IW_WindowName.nVariableName = X
Then if I need to refresh the the internal window I use a local procedure in the internal window and call that from my main window
IW_WindowName.LP_LocalProcedureName
This allows me to have the internal windows be responsive to data entered in the main windows.
I use this method in a quite a few areas and it works well.
Hope this helps.
Steve
Signaler
0
0
Steven Sitas
#5
Posté le 25 juillet 2014 - 19:00
Thanks Steve, I will give it a try
Steven Sitas
Signaler
0
0
Alexandre Leclerc
#6
Posté le 25 juillet 2014 - 19:14
Hi Steven,
If you use ChangeSourceWindow() you can pass parameters at the same time. (I avoid this path because it only works when using that command.)
I personally do as Steve suggested. In every internal Window I have an Initialize/Refresh command and globals. For simplicity I usually avoid the globals because you always miss something. The Initialize/Refresh command usually receives the arguments that need to be refreshed. (Something like that: Refresh(p is string = gsP, b is bool = gsB), so if you do not specify the params, it uses the globals.)
Best regards,
Alexandre Leclerc
Signaler
0
0
Steven Sitas
#7
Posté le 25 juillet 2014 - 19:40
Thanks Alexandre
I just tested what you and Steve suggested and it works fine
Steven Sitas
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