Hi all,
I have a Dropdown on my form with the following properties.
Items | Table({Text: "Examination", Val: "X"}, {Text: "Expiry", Val: "E"}, {Text:"Observation", Val: "O"}) |
Value | Text |
Default | editRecord.EventType |
Reset | resetForm |
I have a gallery of items which the user can select which should then show the appropriate value of the drop down, but it is not. The code for the OnSelect() of the gallery is
Set(editRecord,{ID: ThisItem.Id, EventType: ThisItem.EventType);
// Force update of form controls
Set(resetForm, true);
Set(resetForm, false);
The EventType property is E, X or O, as per the table of items but the Dropdown does not change from the first value in its Items list, irrespective of he value of the EventType field. I can see that the field is changing as per selecting each item as I have a (temporary) label showing the value.
I surley think it's me doing something stupid ... I just cannot see what.
Solved! Go to Solution.
First things first, you must be using a ComboBox as opposed to a Dropdown here because your table has 2 columns: Text and Value. There's a difference in how these controls work so the distinction is important.
For ComboBoxes you need to define a record as the default. I get the feeling that editRecord.EventType only supplies a text value. This will not work.
You'll need to put your table of options into a collection. Do this in the OnVisible property of the screen.
ClearCollect(colOptions, Table({Text: "Examination", Val: "X"}, {Text: "Expiry", Val: "E"}, {Text:"Observation", Val: "O"}))
Then change the Items property of your ComboBox
colOptions
Finally, use a LOOKUP function in the Default property of the ComboBox to retrieve a record value instead of a text value like you were doing previously.
LookUp(colOptions, Val = editRecord.EventType)
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
First things first, you must be using a ComboBox as opposed to a Dropdown here because your table has 2 columns: Text and Value. There's a difference in how these controls work so the distinction is important.
For ComboBoxes you need to define a record as the default. I get the feeling that editRecord.EventType only supplies a text value. This will not work.
You'll need to put your table of options into a collection. Do this in the OnVisible property of the screen.
ClearCollect(colOptions, Table({Text: "Examination", Val: "X"}, {Text: "Expiry", Val: "E"}, {Text:"Observation", Val: "O"}))
Then change the Items property of your ComboBox
colOptions
Finally, use a LOOKUP function in the Default property of the ComboBox to retrieve a record value instead of a text value like you were doing previously.
LookUp(colOptions, Val = editRecord.EventType)
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Smashing ... Thanks
User | Count |
---|---|
122 | |
86 | |
83 | |
74 | |
69 |
User | Count |
---|---|
215 | |
179 | |
140 | |
108 | |
83 |