• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

h:form vs a4j:form

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi tim,
Thanks for your solution.
 
reply
    Bookmark Topic Watch Topic
  • New Topic