Jsni (gwt-gwtp): Jquery Does Not Select Node In 'document Ready' Function After Ready Event Fires
Solution 1:
You should rely on View Lifecycle in order to be sure that it is attached to DOM. from GWTP ViewImpl#onAttach
doc
Method called after the view is attached to the DOM. You should override this method to perform any ui related initialization that needs to be done after that the view is attached and that the presenter doesn't have to be aware of (attach event handlers for instance)
in your case, when $wnd.$('#gramTree').text("text changed from JSNI jQuery");
is called #gramTree element is not attached to DOM and not visible to jQuery.
Solution 2:
Posting this Answer myself as food for thought (it is hackish) that I found elsewhere: Call the JSNI renderTree() method from a Deferred ScheduledCommand.
Seems the 'document ready' method I'm trying to get to work would be the true canonical/intended way to do it. So I'd prefer to figure that out instead...
Post a Comment for "Jsni (gwt-gwtp): Jquery Does Not Select Node In 'document Ready' Function After Ready Event Fires"