I have a combo populated with names – each with a unique ID that is not shown – just the name is rendered.
When I manually select from the combo and submit – the form POST’s the ID of the name which is perfect.
However I need to set the value of the combo dynamically under some circumstances and do by calling setValue(‘Name’) but when I POST the ID value is coming out as the string name set by setValue()
How do I set the name (or the ID) but POST the ID and show the name in the combo?
I have tried calling setRawValue() while passing the ID in hopes the control would translate and show the textual form – but no dice 🙁
You have
setValue()andsetRawValue()backwards. UsesetValue('id')to set the combobox value, it should automatically update the display value if you are using a renderer in the combobox config.Think of
setRawValue()assetDisplayValue().