File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

h:form vs a4j:form

 
Muneeswaran Balasubramanian
Ranch Hand
Posts: 138
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bart Kummel
author
Ranch Hand
Posts: 81
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Muneeswaran,

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.

Best regards,
Bart Kummel
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17641
39
Android Eclipse IDE Linux
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Muneeswaran Balasubramanian
Ranch Hand
Posts: 138
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bart,
Thanks for your valuable suggestion.I will keep a look at Apache my faces Trinidad.


 
Muneeswaran Balasubramanian
Ranch Hand
Posts: 138
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi tim,
Thanks for your solution.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic