In a rich:tab component what is the difference between switchTypes? ajax, client, or server

StackOverflow https://stackoverflow.com/questions/1127003

  •  13-09-2019
  •  | 
  •  

Question

I am trying to implement a search page with 2 tabs: Basic Search Options and Advanced Search Options. The Search button is outside the tab at the bottom of the page.

I am trying to figure out which switchType to use on the rich:tab component. richfaces offers 3 switch types:

  1. ajax
  2. server
  3. client

I don't understand when someone who use one over the other.

Can someone explain succinctly when/how you would use the different switchTypes?

Thanks in advance!

April26

Was it helpful?

Solution

Examples of the three types here.

  1. Ajax - When the tab is clicked on the body of the tab is requested from the server without refreshing the entire page. This makes the initial load time of the page with tabs faster than client switching and allows the user to click between tabs without refreshing the entire page.

  2. Server - When the tab is clicked on the entire page is refreshed to get the body of the tab. Use Server switching when you want to keep the tab page load time down but don't want any ajax code. Clicking between tabs is not very smooth looking.

  3. Client - All tab bodies are loaded when the tab page is loaded. The initial load of the page is slower but switching between tabs is much faster for the user.

I've created several pages that use RichFaces tabs and they all have used client switching. It makes the tabs more usable if the user doesn't have to wait when they click on a tab.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top