PDA

View Full Version : ComboBox not setting on form load



watermark
30 Sep 2011, 11:49 AM
I have several fields in a form that are loading fine from an ajax load. The only fields that aren't loading are the comboBoxes, they stay blank. The store is set to autoLoad and the store definitely loads before the form load occurs. Any ideas?

conorarmstrong
1 Oct 2011, 10:47 AM
Can we see the code? Form, combo, combo store & model and Ajax load code

watermark
3 Oct 2011, 12:39 PM
I had an epiphany and found the issue. The store's id field is set to an int type, while the data from the form load was being sent as a string. The combos had forceSelection set so they showed as blank instead of the id number.

Besides my code now working, I verified by doing a combo.setValue(2) and a combo.setValue('2') and they produced different results (one worked and one didn't).

I have to do some ugly things to make the json for my form load send as an int, so I would prefer it done differently. As the question has now changed, I'll ask if it's possible for setValue to think 2 == '2' on a different thread.