As the title indicates, I am developing a web application with Primefaces in which I use the calendar component. In most cases the component works correctly, however, in some cases the component does not show the calendar. Instead, it is displayed as if it were a simple text field with autocomplete (see image).
The code for that component is as follows:
<p:dialog
header="Generar Paro"
id="dlgGenerarParo"
closable="false" closeOnEscape="false"
width="820" modal="true"
widgetVar="dlgGenerarParo">
<p:layout style="width: 810px; height: 420px;">
<p:layoutUnit position="center">
<p:panelGrid style="border: 0;height:150px;" columns="2" rendered="true">
<h:outputText value="Estado:"/>
<h:outputText
id="txtEstadoParo"
style="font-weight: bold;"
value="#{monitorizadorCentroControlador.generarParoBean.arbolEstadosBean.estadoSeleccionadoDescripcion}"/>
<h:outputText value="Fecha inicio paro:"/>
<p:calendar locale="es"
id="calFInicioParo"
showOn="button"
widgetVar="calFInicioParo"
value="#{monitorizadorCentroControlador.generarParoBean.fechaInicioParo}"
pattern="MM/dd/yyyy HH:mm:ss"/>
<h:outputText value="Fecha fin paro:"/>
<p:calendar locale="es"
id="calFFinParo"
showOn="button"
widgetVar="calFFinParo"
value="#{monitorizadorCentroControlador.generarParoBean.fechaFinParo}"
pattern="MM/dd/yyyy HH:mm"/>
</p:panelGrid>
</p:layoutUnit>
<p:layoutUnit style="border: 0;" size="100" position="south">
<p:messages closable="true" autoUpdate="true" for="generarParoMessages" showDetail="true"
showSummary="false"/>
<p:panelGrid columns="2" style="text-align: center; width: 50%; border: 0;">
<p:commandButton
value="Aceptar"
actionListener="#{monitorizadorCentroControlador.confirmarGenerarParo}"/>
<p:commandButton
value="Cancelar"
actionListener="#{monitorizadorCentroControlador.cancelarGenerarParo}"/>
</p:panelGrid>
</p:layoutUnit>
</p:layout>
</p:dialog>
The only noticeable difference from the correctly functioning calendar controls is that I am using the control in a dialogue, which is likely to be influencing its operation.