Jsf 如何防止用户在Primefaces的日历文本框中输入数据

Jsf 如何防止用户在Primefaces的日历文本框中输入数据,jsf,primefaces,Jsf,Primefaces,在我的代码中,我使用Primefaces日历 <p:calendar id="cal" value="#{accountController.selected.mydate}" styleClass="custom" pattern="dd-MMM-yyyy HH:mm" /> 如果我使用其他模式,例如:pattern=“dd/MM/yyyy HH:MM”,pattern=“dd-MM-yyyy HH:MM”,etc==>用户不能在日历文本框中输入数据 但如果我使用patte

在我的代码中,我使用Primefaces日历

<p:calendar id="cal" value="#{accountController.selected.mydate}" styleClass="custom" pattern="dd-MMM-yyyy HH:mm" />

  • 如果我使用其他模式,例如:pattern=“dd/MM/yyyy HH:MM”,pattern=“dd-MM-yyyy HH:MM”,etc==>用户不能在日历文本框中输入数据
  • 但如果我使用pattern=“dd MMM yyyy HH:mm”==>用户可以在日历文本框中输入数据
所以我想问:如果我使用pattern=“dd-MMM-yyy-HH:mm”,如何防止用户在日历文本框中输入数据

在Primefaces中,具有与Richfaces?的enableManualInput属性等效的任何属性


感谢您的帮助

使用readOnlyInputText of calendar。将readOnlyInputText设置为true,以便用户无法进入输入区域