This is a tip in a tip – using multiple dynamic data tables and switching between them will get you to an unpleasant situation. PrimeFaces does not reset the data table to the first page every time you switch to another table, but this code fixes that problem.

Even if it is not a good idea to hardcode components ids, this can save a lot of time when no solution is available.

2. Use ActionEvent

Another common scenario is like this: I have a PrimeFaces menu, with several menu items. Each menu item has a value attribute, and all of them indicates the same action listener. I want to get the value of the menu item that was selected. The code looks like this: