I have richfaces application. In the page, there is jQuery function defined:
<rich:jQuery timing="onJScall" name="updateUrlHash" selector="#conversationId"
query="alert('in jquery call');" />
Then I have some a4j:commandLink, which should call the function on completing ajax request.
<a4j:commandLink value="test" oncomplete="updateUrlHash(this)" />
Unfortunately, it does not work. I know oncomplete works, because if I put there alert('test');, alert is shown. But when I try to call updateUrlHash function, it does not work. I checked in page source that function is there. What can be wrong?
I found it. Query is called on object selected by jQuery selector. So in example like this, in javascript is it
This of course cannot work. So I need to call anything on selected element, and then I can do what I want:
In Javascript it is then (selected element is hidden anyway):