Alex Rivera | Logout

How to ajax-refresh dynamic include content by navigation menu? (JSF SPA)

Asked 2011-08-18T14:03:11.563
37

I'm just learning JSF 2 thanks to this site I had learned a lot in such a short time.

My question is regarding how to implement a common layout to all my JSF 2 pages and have only the content part of the page refresh not the whole page whenever I click a link/menu from a different panel. I am using the Facelets approach it does what I want except that each time I click a link from a panel (e.g. menu items from left panel) the whole page is refreshed. What I am looking for is a way to refresh only the content part of my page. To illustrate this below is my target pagelayout.

enter image description here Did not post my code because I'm not sure if Facelets can do this . Are there other approach more suited for my requirement other than Facelets?

Edit
Report

1 Answer

2

If you only want to refresh part of the page, there are only 2 ways to go (for the web in general, not just JSF). You have to use frames or Ajax. JSF 2 supports ajax natively, check out the f:ajax tag to update just 1 component without reloading the entire page.

answered 2011-08-18T14:14:01.520

Your Answer