Wednesday 15 June 2011

javascript - How to detect changes in primefaces calendar element? -


I leave the page, then to warn the user, I find out the data I have not saved without my form It works for all elements so far, except the primetime calendar element.

Currently my attitude is related to this but it does not work for the calendar element. I came to know that the change listener does not normally work for programmatic values ​​set. Perhaps this is the reason for my problem, so I tried to implement a very simple "change listener" by registering a click and blurring the listener to all my calendar elements. In the click listener, I temporarily save the current value of the calendar element. In the blurred listener, I compare the value saved with current value. But this approach does not work, because I am not able to get value in exchange for the color element instead of the listener. I tried to get the value in several ways:

  $ (this) .val (); This.value; $ (This) .html (); $ (This) .attr ('value');   

But in each case, I get the old value. So I think that "simple change listener" - also does not work as an application.

My primary versions are 3.4.2.

JSF implementation (probably not relevant): Mojarra 2.1.6

me Nothing is known about the primetime but it uses the jquery ui calendar so you can use the selection option on it to find a change.

  $ ('hedatic picture'). Each (function () {var onSelect = $ (this) .datepicker ('option', 'on-stitched'); $ (this) .date picture ('option', 'onsach', function () {// something Change here, set your flag that the form is filthy Configure to configure (true); // We call the original Select to break the event of the primaryfaces ajax shuffle if (on-seal) { Return on selection (this, argument);}});});    

No comments:

Post a Comment