I have not looked at your attachment but the name gives me a clue.
ChooseList does not let you display the description but save the code. It displays what it saves.
I am not sure why we do not have this option - it seems obvious.
It is not hard to implement - mainly you need to override Get, Set, and NewValue. Here is a quick example:
| Code: |
ChooseListControl
{
New(list)
{
super(list)
.map = Object()
for s in list
{
x = s.Split(' - ')
.map[x[1]] = x[0]
}
}
Set(value)
{
prompt = .map.Find(value)
.Field.Set(prompt is false ? value : prompt)
}
Get()
{
return .map.GetDefault(.Field.Get(), '')
}
NewValue(value)
{
.Field.Dirty?(true)
.Send("NewValue", .Get())
}
}
|