AJAX requests work by replacing HTML, so when the response comes back you need to add the widget again - add oncomplete="applyDatePicker()" to the commandButton. (That said, why not use rich:calendar? You wouldn't have to deal with this kind of problem)
Hi Michal, Thanks for the reply, I've tried to apply the widget oncomplete already but it didn't work. rich:calendar is working but it is not
accepted because of look & feel reasons. I need a way to hook into the ajax process and make the call to the widget but not sure how.
Weird, try debugging it and check what's happening when the function is called, it should be targeting the new element but it's possible the function call happens at a different point than in RichFaces 4. Though if you don't like the way the calendar looks it should still be easier to change the styles.
The problem is that the script is not even available after the Ajax call. this means that the applyDatePicker() method is not called.
i don’t mind to hook the componet and extend a class or something like that but not sure how.
Also, I’m using two different versions of jQuery in the same page. Datepicker requires 1.9.1 and after coming back from Ajax it goi back to 1.3.2. And I can’t bring it back to 1.9.1 from the same reason: script is not available.