If the details page should be idempotent (i.e. it is permalinkable, bookmarkable, searchbot-crawlable), simply use two queries or browse the beans area and use the GET link with the object identifier as the request parameter to go from the main page to the details page . See Also Creating homepage pages for objects, how to link them, and in which bean area to select for a specific example.
If the details page does not need to be idempotent, you can always conditionally display the master and details in the same view or even display the details in some kind of modal dialog box from the main page. Thus, you can continue to use a single bean.
As a JSF, you should not worry too much about the cost of executing the database. Rather, configure and configure it in the save level. For example, in JPA you can configure the second level cache. If you have many more than 500 ~ 1000 items, then consider database pagination.
source share