How does Ajax work in JSF?

I am new to JSF, but I have some experience with ASP.NET and its Ajax features. I know that JSF has Ajax tags that can perform some duties with Ajax, but I wonder how it uses Ajax. Does it use something like ScriptManager in ASP.NET?

+3
source share
1 answer

Whenever you use the JaF tag <f:ajax>, the jsf.jsscript will automatically be included in the HTML header. He will take care of all the magic of ajax. The attributes of the on*generated HTML elements, if necessary, must be changed so that it uses the ajax script correctly. You do not need to worry about this, all you have to do is specify and use the JSF tag <f:ajax>as described. You do not need to manually enable and configure the script as an ASP.NET ScriptManager.

Please note that this only works when you use Facelets as a viewing technology, and not its predecessor JSP. You should also make sure that the main template contains <h:head>instead of plain HTML <head>, otherwise JSF will not be able to automatically include the jsf.jsscript.

, JSF HTML. , View Source. HTML JS, .

+4

All Articles