This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
It is sorta covered in the JavaRanch Style Guide.
subject: Re-Execute Javascript on Ajax Render
Similar Threads
How to render html content that is produced by a backing bean ?
I need help with ajaxSingle, reRender and immediate.
Re-Render Problem after ValidationException
Loose data in my editable datatable (JSF2)
Ajax listener method is not fire for other(except first) component