Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
11
Erster Beitrag:
vor 1 Jahr, 1 Monat
Letzter Beitrag:
vor 1 Jahr, 1 Monat
Beteiligte Autoren:
Patrick Schwarz, Fabrice Harari, DarrenF

Resetting a Combo Box in Android

Startbeitrag von Patrick Schwarz am 13.07.2016 09:55

Hi,

I'm trying to reset a combo box. My attempt was just setting the value of the combo box to null. The Code:
Combo_Qry_Test = Null
In the simulator it all works fine, but on my device it keeps the last selected value.
Any ideas how to solve this?

kind regards
Patrick

Antworten:

Patrick,

ListDeleteAll?

http://help.windev.com/en-US/?3049013

von DarrenF - am 13.07.2016 10:18
I just want that there is no item selected anymore and the combo box returns null as value. Deleting all items is not my purpose.

regards
Patrick

von Patrick Schwarz - am 13.07.2016 11:10
Hi Patrick,

AFAIK, a combobox with nothing elected in it returns -1, not null

Furthermore, to unselect everything in it, you can use listselectminus

Best regards

von Fabrice Harari - am 13.07.2016 11:52
the funny thing, listselectminus change nothing in my combo box. So still no working solution.

regards
Patrick

von Patrick Schwarz - am 13.07.2016 12:33
Hi,

Ok, I see. Just an idea; I use the combo box properties dialog to define the first item in the list as with a return value of 0.

von DarrenF - am 13.07.2016 13:07
Hi Patrick,

Quote
Patrick Schwarz
the funny thing, listselectminus change nothing in my combo box. So still no working solution.

regards
Patrick


Well it does work in my code (on listboxes, I do not use combos), so maybe you should show us your code so that we can find a mistake in it?

Best regards

von Fabrice Harari - am 13.07.2016 21:12
@ Darren:
Defining a custom row is greyed, so not availalable for my platform.

@ Fabrice:
I fill the combo box with data from my databases. I use it to define characteristics of a filter for a sql-query. By clicking on a button i want to set the filter to default.

ListSelectMinus(COMBO_QRY_Test)
HExecuteQuery(...)
Looper Display(...)


Best regards
Patrick

von Patrick Schwarz - am 14.07.2016 09:40
Hi again

did you try doing a multitask just after the listselectminus, so that the OS can do the unselect?

And how do you get the value of combo line for your query?

Best regards

von Fabrice Harari - am 14.07.2016 11:53
Hm i tried it with multiselect but no changes.

I thought about adding a new item with ListAdd and this to return 0, so to solve the problem otherwise. But when i select the new row, it just returns 1.


ListAdd(COMBO_QRY_Test, "Test Row" + gLink ("0"))
gLinkActivate(COMBO_QRY_Test, True)


von Patrick Schwarz - am 15.07.2016 14:15
Hi Patrick,

It looks like even though the Help says that glink is available in Android, that specifically glink = "0" doesn't work as expected on Android. In one of your previous replies you say that the "1st row" (custom) definition is grayed out in the properties dialog :-(

It looks as though Android returns the subscript irrespective of what glink is set to. Wonder what happens if you set all the glink values to "1" - does it still return 1,2,3 etc ?

von DarrenF - am 15.07.2016 15:00
Zur Information:
MySnip.de 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.