I have a simple repeat that displays multiple records for editing. One of the controls is a select box for choosing the state code. When selecting and saving the data, everything is working fine, but when the data is read back for display, the select list is not being set to the saved value. I can see the correct values in the incoming data and the display binding is the same as the save binding, but the select control always displays option[0]. (as a test, I placed a text control in the repeat with the same page display binding and the correct data is displayed. when converted to a pick list, it then exhibited the same behavior..i.e. always loads with option[0] displayed)
RE: Select list in repeat not displaying saved value
Please check that all the bindings are the same, bearing in mind that the select has two bindings for the data value and the text value? Check the repeat as well as the select.
Sometimes the actual data structures are different for display and action bindings, so the repeat binding may differ?
Here is a link that may be related?: Select Box Drop Down (Dynamic) - Top selection not showing
Another possible option is that your select data values/display values are in another repeating structure? Here is another link related to ensuring the correct repeat is used to bind the value: How to default select box value to value from database
If not, we will need more info on doc structures and bindings.
RE: Select list in repeat not displaying saved value
I cannot see any issue with the bindings...
I have attached the project file. The offending table in in the page called 'APD_AppSect3'. The field in question is the "state" bound to the selState control of the table. I have also attached the inbound sql result that is feeding the table currently.
RE: Select list in repeat not displaying saved value
The drop-down list needs to point at another repeating structure for the repeat data and display values, so the "Field Value" needs to be given a context specifically for the particular editable row entry.
If you open up the "XPath Guidelines" for the Select field on the Display Bindings section, it tells you that you need to add a variable prefix value for the field value.
So, I'm guessing in your case it is something like $well_locationsLoopEntry/STATE ?
Try that on any of the selects you need to handle in this manner.
RE: Select list in repeat not displaying saved value