This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a search form on which I have the following INPUT field
When this search form is accessed I can see the date picker attached to the input#pickUpDate element when I click on it.
I submit this search form using DWR by invoking the search(...) function (shown below).
I reset the HTML body element's data with the response I receive. In the response received, I have a similar search form which contains the same input element (input#pickUpDate).However after I reset the body element's data using
in the DWR callback function and try to attach datepicker it does not work.I inspected that the element is appended the datepicker's "hasDatepicker" marker class name but still on focusing/clicking on the input field I cannot see the datepicker.
Following is my jQuery code :
I have gone through all the relevant posts I could find regarding this but the solutions mentioned in them didn't worked for me.
I am in need to know what is the causing the mentioned problem and how to get this resolved?
The Art Of Life Is To Know When To Be Useless And When To Be Useful - CHUANG TZU
Joined: Dec 28, 2004
I have got this resolved.And posting my solution here for reference:
As per what I understood this is the explanation behind what was causing the problem
Before the AJAX call it's value was was set to true by the following block in source code of jquery.ui.datepicker.js (this block can be found near the end of the file)
Since the $.datepicker.initialized value was always found "true" after the HTML was updated on the page by DWR, the presentation div referred to by $.datepicker.dpDiv in jquery.ui.datepicker.js source code was not getting appended to the tag when datepicker() was invoked on an element which was causing the datepicker for not getting displayed though the marker class 'hasDatepicker' was getting applied.
subject: DWR callback updating dom elements, jquery ui datepicker attached to updated element not showing up