简体   繁体   English

Primefaces 5 <p: calendar> 不显示选择时间的选项

[英]Primefaces 5 <p: calendar> does not display the option to select time

Need to use the component p:calendar with the option to select the date and time (hours, minutes and seconds). 需要使用带有选项的p:calendar组件来选择日期和时间(小时,分钟和秒)。

The problem is that the option to select the time is not displayed, only the option to select the date. 问题在于没有显示选择时间的选项,仅显示了选择日期的选项。 I am using the following pattern "dd/MM/yyyy HH:mm:ss". 我正在使用以下模式“ dd / MM / yyyy HH:mm:ss”。

According to primefaces showcase no additional attribute is required for display of schedule options, only define the pattern. 根据primefaces展示 ,显示时间表选项不需要其他属性,只需定义模式即可。

<p:calendar pattern="dd/MM/yyyy HH:mm:ss" value="#{calendarMB.date}" timeZone="GMT-3" />

Managed Bean 托管豆

@Named
@ViewScoped
public class CalendarMB implements Serializable {

    private Date date;

    // get/set
}

I performed the tests with primefaces 5.0 and 5.1 我使用primefaces 5.0和5.1进行了测试


Edit 编辑

Discovered the cause of the problem. 发现问题的原因。 Conflicting versions of jquery. jQuery版本冲突。 We have a template with the following code <h:outputScript library="comum" name="javascript/jquery-1.10.2.js" /> By removing this import component worked as expected. 我们有一个模板,其中包含以下代码<h:outputScript library="comum" name="javascript/jquery-1.10.2.js" />通过删除此导入组件,按预期方式工作。 Thank you all for the help 谢谢大家的帮助

Discovered the cause of the problem. 发现问题的原因。 Conflicting versions of jquery. jQuery版本冲突。 We have a template with the following code <h:outputScript library="comum" name="javascript/jquery-1.10.2.js" /> By removing this import component worked as expected. 我们有一个模板,其中包含以下代码<h:outputScript library="comum" name="javascript/jquery-1.10.2.js" />通过删除此导入组件,按预期方式工作。 Thank you all for the help 谢谢大家的帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM