views:

999

answers:

1

I am creating a portal in jsf with a left menu(rich:panelMenu) and with a content area on the right side. I want to refresh only the content area with different forms on clicking the menu items in the left menu. The menu selection needs to retained. Which is the proper technique to handle this ?

+2  A: 

Do you mean aside from specifying the ID of the content panel in the reRender attribute of your a4j commandButton/commandLink/support tag (or whatever you use as your menu) ?

UPDATE: Well you could use an a4j include like this:

<rich:panel id="menu">
   <a4j:commandLink id="link1" action="#{myBean.setContentViewIdLink1}" reRender="content">Link 1</a4j:commandLink>
</rich:panel>

<rich:panel id="content">
   <a4j:include viewId="#{myBean.viewId}"/>
</rich:panel>

UPDATE#2:

The setContenViewIdLink1 might look something like this:

public void setContenViewIdLink1() {
  this.contentView = "/page1.xhtml";
}
Damo
I am a newbie to JSF and i am really confused. I just want to display different forms on the right panel when the menu items are clicked . Can you please tell me an example ?
Jinesh
Great !!... Got it working ..Thanks for your support damo
Jinesh
Damo, can you give me an example of what your method setContentViewIdLink1 would look like please?
Mark Lewis
Thanks for the update.
Mark Lewis