- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Can't identify the problem
Hi !
I wanted to generate a list for a user so he ca choose the abscissa he wants (for a graph) here is the script :
// Créer une liste des options pour la liste déroulante
options = {"Supplier", "Supplier_Quarter"};
// Créer une boîte de dialogue personnalisée avec une liste déroulante
dlg = New Window("Sélectionnez une abscisse de travail",
<<Modal,
V List Box(
Text Box("Sélectionnez une valeur parmi la liste déroulante:"),
comboBox = Combo Box(options),
H List Box(
// Créer le bouton OK
Button Box("OK", dlg << Close(comboBox << Get Selected)),
// Créer le bouton Cancel
Button Box("Cancel", dlg << Close(""))
)
)
);
// Récupérer la sélection de l'utilisateur
selection = dlg << Get Result;
Print("Vous avez sélectionné : " || Char(selection));
Edit (jthi 2024-08-11): added jsl formatting
Here is the problem : I have a message error : Name Unresolved: Button
What do I have to do to make it works without issues ?
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Can't identify the problem
As you are using modal window, you don't have to close it otherwise. Also dlg doesn't exist after the window has been closed unless you use <<return result. Below is one option what you could do
Names Default To Here(1);
options = {"Supplier", "Supplier_Quarter"};
dlg = New Window("Sélectionnez une abscisse de travail",
<<Modal,
<<return result,
V List Box(
Text Box("Sélectionnez une valeur parmi la liste déroulante:"),
comboBox = Combo Box(options),
H List Box(
Button Box("OK", selection = comboBox << Get Selected),
Button Box("Cancel")
)
)
);
show(dlg);
if(dlg["Button"] != 1,
Throw("Cancelled");
);
Print("Vous avez sélectionné : " || Char(selection));
-Jarmo