PDA

View Full Version : Submit form with both display and value fields of Combobox



ap
3 Dec 2009, 8:01 AM
When I submit the form or use getValues, I would like to have the form to retain both the displayField and valueField in the combobox.

My solution is creating a hidden field , listen to combobox's change event and set the value.

Is there a more elegant solution?

Thanks in advance.

CrazyEnigma
3 Dec 2009, 9:56 AM
I don't see the reason why you would need to retain both, it would defeat the purpose of valueField.

I have only seen one or the other. In fact, you can specify the hiddenName and hiddenValue to use the valueField instead of the displayField as the return in getValues.

ap
3 Dec 2009, 10:03 AM
My form never really submits anything. I just get the values and reload a grid with those params.

When I use the History to repopulate the forms, the setValues does not neccessarily execute after the combo store load. AND I really don't want to load the stores for all the comoboboxes.

So if I can get both values , I could just add a single record to the store for the combobox to display the 'displayField' instead of the 'valueField'.