File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Re-Execute Javascript on Ajax Render Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Re-Execute Javascript on Ajax Render" Watch "Re-Execute Javascript on Ajax Render" New topic

Re-Execute Javascript on Ajax Render

Dominik Müller
Ranch Hand

Joined: Apr 28, 2009
Posts: 36
Hi There,

the problem is that it seems that on an ajax rerender of an partial area of the webpage, the containing javascript code doesn't get called again.
Is there any chance to re-execute the javascript code contained in an partial response?

Dummy Example

Ajax Call > ReRender the Formular (works) > Javascript Code doens't get called again

Somebody an idea?
Thanks a lot
Cesar Loachamin
Ranch Hand

Joined: Dec 25, 2010
Posts: 90

Hi Dominik

You're right the javascript code doesn't call beacuase you're making a partial request and the responso only contain the tags for the components specified in the render attribute of the f:ajax tag.
I have an idea if you always wants to run a javascript function when you make the partial request you can use the javascript event onevent of the f:ajax tag, this funtion is fired tree times throughout the lifetime of an Ajax call: begin, complete, success. I give an example:


When a dream is ending because to come true - OCPJP 6,7. OCE JPA EE6. MCTS
I agree. Here's the link:
subject: Re-Execute Javascript on Ajax Render
It's not a secret anymore!