aspose file tools*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Re-Execute Javascript on Ajax Render" Watch "Re-Execute Javascript on Ajax Render" New topic
Author

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
Dom
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:

Regards
Cesar

When a dream is ending because to come true - OCPJP 6,7. OCE JPA EE6. MCTS
 
 
subject: Re-Execute Javascript on Ajax Render