Hi everybody
I am developing a xhtml page and i am adding a calendar component in which I want to execute a method when users choose a date.
<p:outputLabel for="Fecha_cheque" value="Fecha">
</p:outputLabel>
<p:calendar id="Fecha_cheque" title="Fecha" value="#{ctrl_grupo.dto_qldgent.ldesys}" showOn="button" pattern="dd/MM/yyyy" mask="true" required="false">
- <p:ajax listener="#{list_appointments()}"
</p:calendar>
----------
the instruction ajax was supossely to activate the event but it is not allowed in a calendar componet.
is ther any other instruction I can use to activate the even and therefore call de method list_appointments()
thamks
how can call a method when a date is chosen from a calendar component
-
- Posts: 15
- Joined: 23 Aug 2018, 14:37
Hi
You can use ajax with dateSelect event
IMPORTANT: Your method must be void
You can use ajax with dateSelect event
Code: Select all
<p:calendar ...>
<p:ajax event="dateSelect" listener="#{bean.method}"/>
</p:calendar>
Code: Select all
public void method() {
}
-
- Posts: 3
- Joined: 18 Feb 2019, 23:08
Thanks a lot imikedeveloper. I used it that way and it worked.