|
| WM20: combo filled by query selection |
| Iniciado por guest, 23,nov. 2016 18:51 - 5 respuestas |
| |
| | | |
|
| |
| Publicado el 23,noviembre 2016 - 18: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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 23,noviembre 2016 - 19:07 |
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 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 23,noviembre 2016 - 19:11 |
Thanks Arie,
I'll try that.
Best
Pete |
| |
| |
| | | |
|
| | |
| |
| Publicado el 23,noviembre 2016 - 19:18 |
| Or possibly ListSelectMinus(MyCombo,-1) |
| |
| |
| | | |
|
| | |
| |
| Publicado el 24,noviembre 2016 - 05:28 |
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! |
| |
| |
| | | |
|
| | |
| |
| Publicado el 24,noviembre 2016 - 06:02 |
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... |
| |
| |
| | | |
|
| | | | |
| | |
|