Javatpoint Logo
Javatpoint Logo

Sending Ajax Request

RichFaces provides tag libraries which are capable to send Ajax request from JavaServer Faces pages. Following are the important tags used in the web application.

  • The <a4j:commandButton> and <a4j:commandLink> tags are used to send an Ajax request on the click JavaScript event.
  • The <a4j:poll> tag is used to send an Ajax request periodically using a timer.
  • The <a4j:ajax> tag allow is used to add Ajax functionality to standard JSF components and send Ajax request on a chosen JavaScript event, such as keyup or mouseover.
  • Most components in the r tag library have built-in Ajax support.

The <a4j:commandButton> Tag

to implement this tag we need to create the following files.

// index.xhtml

// User.java

// web.xml

After running index.xhtml file, it produces the following output.

RichFaces Sending ajax request 1

CommandLink Tag

// commandLink.xhtml

// User.java

// web.xml

Output:

RichFaces Sending ajax request 2

<a4j:ajax> Tag

//ajax-event.xhtml

// web.xml

// User.java

Output:

RichFaces Sending ajax request 3




Help Others, Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA