gpt4 book ai didi

java -

Event:dataSelect is not supported in calendar Primefaces 3. 5

转载 作者:行者123 更新时间:2023-12-01 14:09:18 26 4
gpt4 key购买 nike

我正在使用日历 primefaces 3.5,我阅读了 documentation并且您尝试使用ajax事件,但不起作用。

这是view.xhtml的代码

<p:calendar id="calendario-inicio" disabled="#{estadisticoConsultaController.desactivarCalendario}" value="#{estadisticoConsultaController.fechaInicioSeleccionada}" pattern="yyy-MM-dd" navigator="true" yearRange="c-70:c+10">
<p:ajax event="dataSelect" update="mensajesCalendario"/>
</p:calendar>

这是 bean 的代码:

@ManagedBean
@ViewScoped
public class EstadisticoConsultaController extends AbstractCtrl implements Serializable
{

private Date fechaInicioSeleccionada ;

private boolean desactivarCalendario = Boolean.FALSE;

@PostConstruct
private void init (){
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, -2);

//first day of the month
int primerDiaMes = c.getActualMinimum(Calendar.DAY_OF_MONTH);
//lasted day of the month
int ulitimoDiaMes = c.getActualMaximum(Calendar.DAY_OF_MONTH);
//current month
int mes = c.get(Calendar.MONTH);
//current year
int ano = c.get(Calendar.YEAR);
GregorianCalendar calendario = new GregorianCalendar(ano,mes,primerDiaMes );
this.fechaInicioSeleccionada = calendario.getTime();
}

public void controladorFechaInicio(SelectEvent event){
this.fechaInicioSeleccionada = (Date) event.getObject();
....
}
//getter's and setter's ...
}

当我尝试运行应用程序时,收到下一条消息:

@34,96 <p:ajax> Event:dataSelect is not supported.

和堆栈 Trece:

 ....
Event:dataSelect is not supported.
at org.primefaces.component.behavior.ajax.AjaxBehaviorHandler.applyAttachedObject(AjaxBehaviorHandler.java:149)
at org.primefaces.component.behavior.ajax.AjaxBehaviorHandler.apply(AjaxBehaviorHandler.java:127)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:190)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:190)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
.....

所以,

我做错了什么?

如何解决?

最佳答案

您有一个拼写错误:“dataSelect”应为“dateSelect”。

关于java - <p :ajax> Event:dataSelect is not supported in calendar Primefaces 3. 5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18666319/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com