Assume the following silly code fragment in a plone 5 page template:
<input id="foo" class="pat-pickadate" />
<input id="bar" />
<script type="text/javascript" >
$('#bar').click( function () {
$('#bar').addClass("pat-pickadate");
});
</script>
You will get two inputs. The first is a nice calendar input and the second is empty at start. After clicking the second input its class will be set to "pat-pickadate" - like the first - but no calendar is rendered.
I came across this while trying to find the reason, why my jquery-UI overlays displaying plone add, and edit views do no longer (Plone5) show calendar widgets at all.
Is this behavior intended? If so, what is the correct way to use mockup widgets in forms dynamically obtained by AJAX calls in Plone 5? Is there some magic call to inform the Mockup machinery of the DOM change?
I read that Mockup has its own overlay technique, but it is hard to rewrite some 600 lines of complex JS code just to get a simple widget right.
I was not able to find any documentation nor examples on this topic. Can anyone put me in the right direction, please?