Challenges with Select component - values change back to 1st value in list
Happy Thursday...
I have a control on a UI that I'm using a list of values - selected by the user in a Select component.
during selection and then reading from the control and placing values in the db the control works fine.
However, when I read the data from the db - move the contents from an array - and then values into my select components.... in the data read service.successs method I place data in the control - and then log it back to the console. the value on the control is correct.
the next event to occur is page show - and I have no code manipulating the values of these select components - and much to my dismay - all of them have reverted backi to having the value of the first item in the list (despite the fact that I logged the value immediately prior to page show and it was correct....).
here's the output from my log of the value on the control versus what was in the db - and
Color value for tee:1is:#e9ed11 versus:#e9ed11 VM231687:675
Color value for tee:2is:#a8a82f versus:#a8a82f VM231687:675
Color value for tee:3is:#78786d versus:#78786d VM231687:675
Color value for tee:4is:#121111 versus:#121111 VM231687:675
followed by my completed event for the read:
golf course read complete & successful VM231687:612
followed by logs of the values of the same 4 controls milliseconds later in the page show even... and you can see all of the data values have changed on the controls:
Tee 1 color :#d41140 VM231687:811
Tee 2 color :#d41140 VM231687:812
Tee 3 color #d41140 VM231687:813
Tee 4 color :#d41140
I tried turning off 'data reading' which is done by the select control at startup per the Jquery docs for these controls by issuing this command....but I don't really understand if this is the issue or not.:
Appery( scontrolname ).selectmenu( "option", "defaults", true );
(this should cause the control to ignore the default code to attempt on startup to read from the data - and just still with the default - current value assigned to it....
but there is no effect.
Anyone have any experience here - I could sure use the help. This is somewhat frustrating...