When my Form pops up, the default field value is set per the above code. HOWEVER, if the user (me) doesn’t physically click on the DatePicker field and select a date, whether that’s today() or any other date, the field value does not save to the binded table. Thus, I wanted to know if there’s another snippet of code I can add that would resolve this issue?
Another option would be to set the self.item value instead of the date picker value. You have data binding in place, so the date picker would be updated automatically when you update the corresponding self.item entry.
@jshaffstall Thank you for the response. I had a look at your link, and I would like to use the latter option. Can you provide example syntax for setting the self.item value?
I can’t provide exact code, since I don’t know what your data binding looks like. But, in general, if you have the data binding for your date picker to something like self.item['date'], then you would set that value:
self.item['date'] = somenewdatevalue
You might need to call self.refresh_data_bindings() after that to trigger the date picker to refresh, I can’t remember if it triggers in that situation or not.