How to clear a dropdown?
How to clear a dropdown?
I wonder how we can clear a dropdown. I find that if I set up a dropdown with fewer items than previous time the form is displayed, the dropdown will have remaining items still intact. For example, if a dropdown has been set up with items AAA, BBB, CCC, DDD, EEE and then set up again on next display of the same form with items FFF, GGG. The resulting dropdown will contain items FFF, GGG, CCC, DDD, EEE.
Re: How to clear a dropdown?
Hi CK,
You can clear a drop down with logic like this:
(Say the Dropdown's name is DDOWN1)
When (= CLEAR)
#COM_OWNER.IsNewForm := False
#Com_Owner.Set_null Property(DDOWN1.Item)
#COM_OWNER.Set_Label Name('/Form.Popover') Text('Dropdown cleared') Color(Blue)
#Com_Owner.Set_Form Show_Popover(TRUE)
You can clear a drop down with logic like this:
(Say the Dropdown's name is DDOWN1)
When (= CLEAR)
#COM_OWNER.IsNewForm := False
#Com_Owner.Set_null Property(DDOWN1.Item)
#COM_OWNER.Set_Label Name('/Form.Popover') Text('Dropdown cleared') Color(Blue)
#Com_Owner.Set_Form Show_Popover(TRUE)
Re: How to clear a dropdown?
Should this work in RPG too? I have a dropdown called SHOWROOM. It loads up fine with all entries. If the selection criteria changes their may be no valid SHOWROOMS so I want to clear the dropdown list. I tried:
LRNG_SetProperty('Item' : 'null');
That results in an error message the SHOWROOM.ITEM property is not recognized. How can I clear the dropdown if that is the only change on the form?
LRNG_SetProperty('Item' : 'null');
That results in an error message the SHOWROOM.ITEM property is not recognized. How can I clear the dropdown if that is the only change on the form?
-
tsupartono
- Posts: 289
- Joined: Wed Apr 18, 2012 10:21 am
Re: How to clear a dropdown?
Yes this would work in RPG too.
My guess is that you probably are missing 'Form.Fields' when referencing the dropdown.
The fully qualified name of the dropdown is 'Form.Fields.SHOWROOM', so you'd need to refer to the property as 'Form.Fields.SHOWROOM.Item'
To clear the dropdown entries, you can do the following:
LRNG_AssignNullToProp('/Form.Fields.SHOWROOM.Item')
My guess is that you probably are missing 'Form.Fields' when referencing the dropdown.
The fully qualified name of the dropdown is 'Form.Fields.SHOWROOM', so you'd need to refer to the property as 'Form.Fields.SHOWROOM.Item'
To clear the dropdown entries, you can do the following:
LRNG_AssignNullToProp('/Form.Fields.SHOWROOM.Item')