Search code examples
gwtcallbackgwtquery

GWT Query selector not working


GWT Query selector i.e. $("#id") not working inside callback function. However xyz.find("#id") works, where xyz -> Gquery variable. Is it that callback function doesn't support $ selector or is there some other problem.


Solution

  • Are you sure that the element with id "id" is attached to the dom when the callback function is called ?

    When you execute $("#id"), gQuery try to find elements matching the selectors within the set of elements of the DOM tree . When you execute xyz.find("#id"), gQuery try to find elements matching the selectors inside the array of elements selected by xyz no matter the elements are still or not in the dom tree.