user1072089 user1072089 - 1 year ago 200
jQuery Question

PrimeFaces calendar has old value in onblur event

I'm trying to copy calendar's value into inputText field (don't ask me why) in the following way:

<p:calendar id="cal" widgetVar="calWidget"
<p:inputText id="text" widgetVar="inputWidget" />

I've overridden PF functions, that's all working fine, the problem is that inputText gets previous selected date i.e. inputText is always one step behind with values. Is this expected behaviour and does anyone have any suggestions? Thanks.

P.S. I tried simpler solution also, same thing happens:


Answer Source

Use dateSelect event:

<html xmlns=""
<h:head />
        <p:calendar value="#{myDate}">
            <p:ajax event="dateSelect" update="dateOutput" />
        <p:inputText id="dateOutput" value="#{myDate}" />
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download