I have a situation where I have a p:imageSwitch and a ui:repeat to show a few images and some image data.
They are placed in a p:panel like this:
<p:imageSwitch id="mediaSwitcher" effect="fade" widgetVar="switcher" slideshowAuto="false">
<ui:repeat value="#{mediaListBean.items}" var="item">
SHOW IMAGE
SHOW IMAGE DATA
</ui:repeat>
</p:imageSwitch>
The thing is that sometimes, not all the time, the image switcher will show no images even if there should be images in the items list.
When this happens a simple F5 is enough for it to show correctly.
So my thought is that the frontend doesnt wait for the backend to get all the data from the backend and instead it just thinks that it is empty and shows no list. Then the second time the data is already in my bean and can be loaded directly.
Is there a good way to make the frontend wait for the server? I have tried to do an update on the image switcher when the page has loaded but that doesnt help :(
So I figured it out. The problem was actually in the database. I did an insert that has a column with "validFrom" that had second precision. And when I inserted something and tried to view it the same second it would not show up. So all I had to do was add a >= to my sql query instead of just >.
Really silly error by me.