Hi to all,
I am new to jsf.I am trying to write code in jsf. i so confused with h:form and a4j:form.So I need a difference between h:form and a4j:form.Up to my knowledge,
a4j:form is used for ajax request.It converts non-ajaxable component like a h:commandbutton to ajaxable component.Please give any other difference between the above two.
Thanks in advance.
In my humble opinion, the use of Ajax4JSF isn't needed any more. I think you'll be better of by using components that have AJAX functionality embedded. Take a look at the MyFaces Trinidad component set for example. They already have AJAX embedded in the components.
That set, most component sets (Trinidad included) have their own "form" component. The best thing to do is to choose a single component set for your project and use that set for everything. Then you can use that component set's form component on all your pages.
I hope this will help you with your first steps on the JSF path.
According to the RichFaces docs, the a4j:form is "almost never" needed anymore. Unfortunately, they're not very specific on what the few remaining cases are. Originally it provided AJAX support that is now done transparently. Although I experimented with a4j:form when I had some very sticky problems, I don't recall any problems that actually were solved by using a4j:form instead of h:form.
I think you're incorrect on the ability for an a4j form to "convert a commandButton". The attributes of the h:commandButton are not extensible, so the only AJAX support a plain commandButton should have is the same level that a straight (non-JSF) HTML commandButton has. The a4j:commandButton adds extra AJAX-supportive features like the reRender attribute, but it's a distinct tag precisely because JSF tags are not directly extensible.
An IDE is no substitute for an Intelligent Developer.
Joined: Mar 19, 2010
Thanks for your valuable suggestion.I will keep a look at Apache my faces Trinidad.