Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
6
Erster Beitrag:
vor 12 Monaten
Letzter Beitrag:
vor 12 Monaten
Beteiligte Autoren:
Peter Muckle, DarrenF, Yogi Yang, DerekT, Arie

WM20: combo filled by query selection

Startbeitrag von Peter Muckle am 23.11.2016 17:51

Hi all,

For combos that are filled by queries (Android) the first item in the list is automatically selected for new records.

I want this to be blank until a selection is made.

Custom first line isn't support.

My only work around is to have a blank record in the lookup file, but this leaves a blank line at the top of the dropdown list, which I'd rather not have.

Any ideas?

Thanks

Pete

Antworten:

Peter,

I know a radiobutton can be un-selected by setting it to -1. Maybe this will work for the combo as well.
your_combo = -1
after the combo is filled

von Arie - am 23.11.2016 18:07
Thanks Arie,

I'll try that.

Best

Pete

von Peter Muckle - am 23.11.2016 18:11
Or possibly ListSelectMinus(MyCombo,-1)

von DerekT - am 23.11.2016 18:18
Quote
Arie
Peter,

I know a radiobutton can be un-selected by setting it to -1. Maybe this will work for the combo as well.
your_combo = -1
after the combo is filled

I tried and this does not work!

von Yogi Yang - am 24.11.2016 04:28
Hey Peter,

The Help specifically states that -ve numbers are not supported in Android. Just tested and ListSelectMinus(ComboName,1) doesn't seem to work either even though the Help seems to suggest it is supported in Android :confused:

Ah well... I'm having a similar issue in WM21; where I don't want the first item always displayed/selected in a few of my "static" data combo's (like tax code or country selection). Now in WD, I'd just use the "1st custom row" facility, with a value of 0, but the "1st custom row" isn't supported in Android and also the Help specifically states a -ve value isn't permitted either.

So if it helps (as an alternative), my solution is to simulate the "1st custom row" functionality by creating a 'dummy' row in the (static data) table in question with an ID = 0 (using "hForceIdAuto" in the HAdd), and a description of something like "Please select...". So in my case "Please select..." is displayed by default. The Combo is normally an FK (foreign key) value, so if nothing is selected it remains as 0 and if something IS selected then it sets the FK value to the ID of the selected row :spos:

Also, doing it this way, your queries can be written to include or exclude the '0' row as required.

HTH...

von DarrenF - am 24.11.2016 05:02
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.