Javatpoint Logo
Javatpoint Logo

PrimeFaces Ajax Dropdown

PrimeFaces provides an easy way to create dynamic dropdown on the basis of filter. A new dropdown is formed by Ajax call. The <p:ajax> tag call Java method after each event is occurred.

In the following example, we are creating two dropdown. This example includes the following files.

JSF File

// ajax-dropdown.xhtml



After executing, it produces the following output.


PrimeFaces Dropdown 1

The second dropdown contains the city names for each country. Each time country is selected, city dynamically updates.

PrimeFaces Dropdown 2
PrimeFaces Dropdown 3

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA