-
1. Re: Datepicker is not working after ajax call using <a4j:commandButton
michpetrov Dec 6, 2017 11:17 AM (in response to itays100)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)
-
2. Re: Datepicker is not working after ajax call using <a4j:commandButton
itays100 Dec 7, 2017 4:07 AM (in response to michpetrov)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.
-
3. Re: Datepicker is not working after ajax call using <a4j:commandButton
michpetrov Dec 7, 2017 5:16 AM (in response to itays100)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.
-
4. Re: Datepicker is not working after ajax call using <a4j:commandButton
itays100 Dec 7, 2017 6:09 AM (in response to michpetrov)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.