This content has been marked as final.
Show 3 replies
-
1. Re: Pulling RichFaces based xhtml from server dynamically?
ilya_shaikovsky Mar 13, 2009 5:36 AM (in response to sarikan)It different to tell about the problem with description ony.. Provide the code you using for exploration.
-
2. Re: Pulling RichFaces based xhtml from server dynamically?
ilya_shaikovsky Mar 13, 2009 5:37 AM (in response to sarikan)different - difficult :)
-
3. Re: Pulling RichFaces based xhtml from server dynamically?
sarikan Mar 13, 2009 8:49 AM (in response to sarikan)Hi there,
You're right, I should have been clearer :) Ok , here comes the details. This is the piece of javascript that gets executed in the application:var ajax = new Ajax.Updater( content.id, contextPath + '/ajax/paneDispatch.jsf', { method: 'get', evalScripts: true, onComplete: function() {newContentArrived( contentName );}, onFailure: refreshAll, parameters: 'element='+contentName+ '&original='+originalId+ '&serialNo='+serialNo + '&accountUserId='+accountUserId});
This code will get my RichFaces enhanced xhtml from the server. And tracing the traffic with Firebug, I can see that it does so indeed.
The problem is, RichFaces generates script tags and javascripts which are NOT added to the page. The following is a copy paste from the Prototype library documentation:If your server logic returns JavaScript code along with HTML markup, the Ajax.Updater object can evaluate that JavaScript code. To get the object to treat the response as JavaScript, you simply add evalScripts: true; to the list of properties in the last argument of the object constructor. But there's a caveat. Those script blocks will not be added to the page's script. As the option name evalScripts suggests, the scripts will be evaluated.
Since the Richfaces generated scripts are in the form of script tags and funtion declarations, they are not added to the page, they simply get lost. This stops the widgets from functioning. Basically it takes Javascript from Ajax of Richfaces :)
I am looking for a way to place this content as if it has been loaded into the page from the beginning, so that a.xhtml and b.xhtml (both including richfaces components) can be placed on the page, ie: as a response to a button click.
I hope I can explain my problem, and I definetely hope there is a way to do this. Both ends of this is out of my control, an existing app on one hand, and Richfaces on the other..
Many thanks for your kind reponse
Regards
Seref