Reputation: 149
I am new to JSF, but I have some experience with ASP.NET and its Ajax features. I know that JSF has some Ajax tags that can do some duties with Ajax, but I wonder how it uses Ajax. Does it use something like ScriptManager in ASP.NET?
Upvotes: 3
Views: 1102
Reputation: 1108722
Whenever you use the JSF <f:ajax>
tag, the jsf.js
script will be auto-included in the HTML head. It will take care about all the ajax magic. The on*
attributes of the generated HTML elements will where necessary be altered that way so that it uses the ajax script rightly. You don't need to worry about this all, all you need to do is to specify and use the JSF <f:ajax>
tag as documented. You don't need to manually include and configure the script like as ASP.NET ScriptManager.
Note that this only works when you use Facelets as view technology, not its ancient predecesor JSP. You also need to make sure that you've a <h:head>
instead of plain HTML <head>
in the master template, otherwise JSF won't be able to auto-include the jsf.js
script.
All with all, JSF ultimately generates plain HTML. Just open page in browser, rightclick and View Source. If you are well familiar with basic HTML and JS, everything will be obvious.
Upvotes: 4