Has anyone encountered this problem?
Ricardo, I am not using cell renderers.
you could check the text encodings you send to the listbox.
this can hang completely the rendering of the page.
Jean-Yves, the data comes from a SQLite database, but I write to the database using a Xojo app and read from it using a Xojo app, so I think that it all should be UTF-8, right? Also, how could this cause a failure sometimes and not other times? The data read into the listbox is the same every time.
OK, more information. The problem with the ListBox not showing is actually a problem with the WebPage.Shown event not firing. This does seem to have something to do with at least one of the date pickers on the page: when this error happens, one of the two date pickers is always blank and neither operates. I took Jean-Yves’ suggestion (thank you!) and saw this in the error console:
Can anyone help me interpret what this means? It looks like there is something wrong with either my server or the Xojo date picker.
Can you create a sample project?
Ricardo can take a look.
What language is set in your server and in your browser?
I’ll work on a sample project. I can’t reproduce the error on Chrome, so it may be a Safari problem. I am using Safari 14.1.2 on MacOS 10.14.6. The server is running Rocky Linux 8.
It looks like the date picker is having trouble parsing the initial values. IIRC, they need to either be in SQLDate format YYYY-MM-DD or in whatever format is native to the region the user is in.
Wouldn’t creating a DateTime object and assigning it to the date picker be a more generic way of handling this since it wouldn’t matter the region the user is in?
Thanks, Greg, for the suggestion. But the problem is that when this fails, the WebPage.Shown event doesn’t even fire, which is where I initialize the DatePickers. (In the Shown event, I do what Hector suggests, by creating DateTime objects and assigning them to the DatePickers.)
You said above that the shown event isn’t firing at all. If that’s the case, the problem is not in the shown event.
I would start by going to the IDE and confirming that the default value for the date pickers is blank or have sql dates in them and then recheck to make sure that their value is not being set anywhere else. Intermittent problems like this can often be caused by event order bugs that are inherent in web apps because of transmission latency.
Sorry Greg, I misinterpreted what you meant.
I tried what you suggested. The error occurs whether the initial date is blank or whether I set it to a particular SQLDate. I have two date-time pickers, and when the error occurs, the first one in tab index order remains set to the initial date supplied in the inspector. The second one is always set to the present day, no matter what the initial date was. Neither are operable: if you click on them, nothing happens.
Since the Shown event is firing, my code might in principle have been at fault. However, I have excised the code in the Shown event that updates the date pickers and the error still occurs. Moreover, when the error occurs, both date pickers are inoperable, even after the interface is updated. So the problem appears to be intrinsic to the WebDatePicker class.
The next step, I guess, is to write my own date picker.
If you really want a more featureful DatePicker(or ListBox, or just about anything else), I have GraffitiDateTimePicker.
Thanks also for your suggestion of the GraffitiDateTimePicker. I’ll have a look. But after all this, I had decided that a standard date-time picker was not necessarily the best way to do what I wanted anyway.
$(I) probably must have been