Ala Varos
Ala Varos

Reputation: 1725

Event dateSelect on primefaces ajax in calendar not working

I have a calendar:

<p:calendar id="fechaInicio" mode="inline"
   value="#{informesBean.fechaInicio.fecha}"
   pattern="#{informesBean.fechaInicio.pattern}">
   <p:ajax event="dateSelect" listener="#{informesBean.limpiaLink}"
      update="link" />
</p:calendar>

And this is my limpiaLink in informesBean:

public void limpiaLink(SelectEvent event) {
    Date date = (Date) event.getObject();
    extraido = false;
    System.out.print(date.toString());
}

And I have a breakpoint in line

Date date = (Date) event.getObject();

But never stop in my breakpoint, What I'm doing wrong?

EDIT: With Inspect Element of Chrome I just realized that when I click on a day of my calendar, chrome throw this:

POST http://localhost:8080/quickpacity/pages/planificacion/informeTestManager.xhtml 500 (Error Interno del Servidor) jquery.js.xhtml:21
send jquery.js.xhtml:21
bG.extend.ajax jquery.js.xhtml:21
PrimeFaces.ajax.AjaxUtils.send primefaces.js.xhtml:1
PrimeFaces.ajax.Queue.offer primefaces.js.xhtml:1
PrimeFaces.ajax.AjaxRequest primefaces.js.xhtml:1
PrimeFaces.ab primefaces.js.xhtml:1
PrimeFaces.cw.behaviors.dateSelect informeTestManager.xhtml:34
PrimeFaces.widget.Calendar.PrimeFaces.widget.BaseWidget.extend.fireDateSelectEvent primefaces.js.xhtml:6
cfg.onSelect primefaces.js.xhtml:6
$.extend._selectDate jquery-plugins.js.xhtml:147
$.datepicker._selectDate jquery-plugins.js.xhtml:340
$.extend._selectDay jquery-plugins.js.xhtml:147
handler.selectDay jquery-plugins.js.xhtml:147
bG.event.dispatch jquery.js.xhtml:14
b6.handle.b4

Upvotes: 3

Views: 15363

Answers (1)

Ala Varos
Ala Varos

Reputation: 1725

I found my mistake, I didn't put the calendar inside a form, ouch!.

I leave this here in case anyone have the same problem.

Greetings.

Upvotes: 5

Related Questions