PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Help needed with two comboboxes, please!
Help needed with two comboboxes, please!
Débuté par Stephan Wiestner (swissstephan), 27 mar. 2006 11:27 - 1 réponse
Posté le 27 mars 2006 - 11:27
Hello
I searched the whole archive for a clue, but didn't find one and I'm turning in circles.
Situation:
I have a file with two fields "TableName", "TableField".
These two fields are linked to two window controls Type (combobox)
Combo TABLENAME holds some TableNames "Addresses", "Products", "ARTICLES" and so on entered in Initial Values
Combo TABLEFIELD will be loaded with HListItem(TABLENAME) depending on selected TABLENAME.
Actual:
After Initialision of the Controls the two combos both have the value -1, I can live with that.
In the windows initialisation code I read the file and use FiletoScreen() which works fine for TABLENAME (shows the right value) and doesn't work for TableField(value still -1)
Even after repeating the initialisationcode it doesn't work!
GLOBAL defined in window
gcSaveTable is string = ""
gcSaveField is string = ""
Initialisationcode of COMBO "Tablefield"
LOCAL
lcString is string = ""
lnListSubscript is int
gcSaveTable = ""
gcSaveField = MySelf
IF Length(TableName..DisplayedValue) THEN
IF lcSaveTable <> TableName..DisplayedValue THEN
ListDeleteAll(MySelf)
lcString = HListItem(TableName)
ListAdd(MySelf,lcString)
gcSaveField = "-1"
gcSaveTable = TableName..DisplayedValue
END
IF gcSaveField <> "-1" THEN
lnListSubscript = ListSeek(MySelf, gcSaveField)
IF lnListSubscript<>-1 THEN
ListSelectPlus(MySelf,lnListSubscript)
END
ELSE
ListSelectPlus(MySelf,1)
END
END
gcSaveField = myself
What do I do wrong? Thanks for your help!
Posté le 27 mars 2006 - 12:04
Hello Louis
Thanks for your help.
I solved the problem with changing steps:
Before:
Initializing control with no table name
read record
file to screen
Initializing control again
Now:
Read record
Initializing control with right table name
file to screen
and it works! Please don't ask me why ;-)
Thanks again!