Windev Mobile combobox does not return a value for exactly 1 row

Startbeitrag von Edwin01 am 06.07.2013 06:06


I have a couple comboboxes in my Android mobile app. The comboxes get dynamically filled by this code:

WHILE HOut(DST_Middelen) = False
IF ListSeek(CBO_Categorie, DST_Middelen.categorie_id) = -1 AND DST_Middelen.Categorie "" THEN
ListAdd(CBO_Categorie, DST_Middelen.Categorie + gLink(DST_Middelen.categorie_id))
IF ListSeek(CBO_Status, DST_Middelen.status_id) = -1 AND DST_Middelen.status_nl "" THEN
ListAdd(CBO_Status, DST_Middelen.status_nl + gLink(DST_Middelen.status_id))
CBO_Categorie..Sorted = True
ListInsert(CBO_Categorie,"", 0)

A chosen value is handled by this code:
Selecting a row event:
sSelectedCat = CBO_Categorie..DisplayedValue
iSelectedCatId = CBO_Categorie..StoredValue

For some reason, all the comboboxes don't return a value (neither DisplayedValue or StoredValue) for just one row, I believe allways the first row.

Someone any ideas? Thanks in advance.




To retrieve the CBO_Categorie..StoredValue inserted usging gLink you need to use gLinkActivate(CBO_Categorie, True) prior to making the selection to return the value

von DerekT - am 06.07.2013 07:56
Hi Derek,

Thank you for your reply. Unfortunatelly this does not seem te be the solution. According to the documentation true is the default value. Also the glink value is returned for all rows, except for one row. Can it be that the problem has to do with ListInsert having no glink value?

Kind regards,

von Edwin01 - am 07.07.2013 10:17
Hello Edwin

A couple of ideas from Windev ( I appreciate your issue is in mobile)
Over the years I have become dubious about trusting Windev defaults and so, for example, I always include a file name in Hfound() and HOut() as I notice you do also. In similar fashion I always explicitly set GlinkActive(myself,true) or False and I suggest you might try also.

The other is that GLink() is a string function so I always populate it with strings so I would have coded:
ListInsert(CBO_Categorie,"", Glink("0"))
I don't believe the code you are using for ListInsert() will insert a Glink type value without actually using the GLink() command even though it is in the correct physical position

I normally use NumToString() with Glink and numeric ID's
ListAdd(CBO_Status, DST_Middelen.status_nl + gLink(NumToString(DST_Middelen.status_id,"10d")))

iSelectedCatId= val(CBO_Categorie..StoredValue)


von Al - am 07.07.2013 18:27
Hi Al,

Thank you very much for the comprehensive answer. I indeed use mobile. I have made your advises but it still does not work. I now figured out that the "selecting a row" event is not firered at all. I have put an info() in the event and what I see is that the event code is run on every row select except for the first row after "".

Kind regards,

von Edwin01 - am 08.07.2013 05:35
Hi Edwin,

may be you should try a row "< Empty >" instead of a row "".

von Stefan Bentvelsen - am 08.07.2013 13:39
Hi Stefan,

I tried but it didn't help.

Kind regards,

von Edwin01 - am 08.07.2013 13:44
Zur Information: hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.