Problem with WebDatePicker

I’m working on an app that has a WebListBox, a WebDatePicker, and several other controls on a container. To avoid having a save button, the container has an Updating boolean property that is set True whenever a control value is changed. The listbox SelectionChanged event fills the DatePicker and other controls from a database. The last line of that event code is “Updating = False”. When I put breakpoints on that line and the DatePicker,DateChanged event (“Updating = True”), I find that the DateChanged event fires after the Listbox.SelectionChanged event has completed. This forces an unwanted updating of the database rewriting the same data.

I tried setting a SkipThis boolean property True in the SelectionChanged code right before updating the DatePicker and conditioning the “Updating = True” statement not to fire when SkipThis = True, but it had no effect. Is this a bug, something I can work around, or something I have to live with?

You may need to provide a sample project with what you tried.

The problem is that the “change” goes all the way to the browser and back and then fires the DateChanged event. You’re going to have to come up with another plan I’m afraid.

1 Like

…perhaps trap the ‘current’ state of the date and do a comparison of the before and after the refresh event. Does seem like a terrible workaround :-/

I’m having a hard time reproducing this.
Added WebListbox, WebDatePicker, reproduced the DateChanged event firing, added SkipThis to the window, was able to avoid DateChanged by checking SkipThis in DateChanged event.

Greg OTesters

The problem is that the “change” goes all the way to the browser and back and then fires the DateChanged event. You’re going to have to come up with another plan I’m afraid.

I added a 1 second timer to set Updating = False to the ListBox.SelectionChanged. Problem solved.