Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6255579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:23:27+00:00 2026-05-24T14:23:27+00:00

Hi there Im just learning JSF 2 using Primefaces. I have a question regarding

  • 0

Hi there Im just learning JSF 2 using Primefaces.
I have a question regarding their Panel example. I would like to use the left panel as a placeholder for my Navigation Menu and the center panel for the contents/pages. Each time I click the menu the whole page gets refreshed, what I would like to accomplish is that when I click the menu only the center panel will load the corresponding page. Is this possible using primefaces or other techniques for jsf 2?
Below is the code I am using. Thanks in advance.

Thanks for your quick reply. I tried your suggestion but got some errors. Sorry Im really new to jsf2 and primefaces. Thanks in advance.

ERROR MESSAGE:
/homepage.xhtml @26,84 Tag Library supports namespace: http://primefaces.prime.com.tr/ui, but no tag was defined for name: menuItem

Below is my code for my view (homepage.xhtml)

<p:layout fullPage="true">
<p:layoutUnit position="top" height="75" header="Top" resizable="true" closable="true" collapsible="true">  
        <h:outputText value="North unit content." />  
</p:layoutUnit>  
<p:layoutUnit position="bottom" height="75" header="Bottom" resizable="true" closable="true" collapsible="true">  
        <h:outputText value="South unit content." />  
</p:layoutUnit>        
<p:layoutUnit position="left" width="250" header="Left" resizable="true" closable="true" collapsible="true">  
        <h:outputText value="West unit content." />        
<p:menu type="plain">
<p:submenu label="Mail">

<p:menuItem actionListener="#{navBean.setPage('pageName')}" update="centerPanel" />

<p:menuitem value="Gmail" url="http://www.google.com" />
<p:menuitem value="Hotmail" url="http://www.hotmail.com" />
<p:menuitem value="Yahoo Mail" url="http://mail.yahoo.com" />
</p:submenu>
<p:submenu label="Videos">
<p:menuitem value="Youtube" url="http://www.youtube.com" />
<p:menuitem value="Break" url="http://www.break.com" />
<p:menuitem value="Metacafe" url="http://www.metacafe.com" />
</p:submenu>
<p:submenu label="Social Networks">
<p:menuitem value="Facebook" url="http://www.facebook.com" />
<p:menuitem value="MySpace" url="http://www.myspace.com" />
</p:submenu>
</p:menu></p:layoutUnit>
    <p:layoutUnit position="center" id="centerPanel"> 

    <h:include src="#{navBean.page}.xhtml" />

        This is the center panel
    </p:layoutUnit>        
</p:layout>

This is my code for my bean NavBean.java

package somePackage;

import javax.faces.bean.*;

@ManagedBean
@SessionScoped
public class NavBean {
      private String page = "login";
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T14:23:28+00:00Added an answer on May 24, 2026 at 2:23 pm

    Something like this JSF dynamic include using Ajax request.

    In your p:menuItem use action attribute instead of url, to make ajaxcal and in the center panel you can use h:include and change the value of the src attribute in h:include in the method in your backing bean. It can also be actionListener instead of action.

    Managed bean –

    @ManagedBean
    @SessionScoped
    public class NavBean {
    
        private String page = "default";
    
        //getter/setter for page
    

    View –

    <p:menuItem actionListener="#{navBean.setPage('pageName')}" update="centerPanel" />
    
    //center panel with id="centerPanel"
    <h:include src="#{navBean.page}.xhtml" />
    

    You don’t wan’t to refresh page but make an ajaxcal, change the value page and update the center panel.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just learning Qt and have a very basic question. If there is
I have been just learning redis and node.js There are two questions I have
I'm just learning C++ and started using different libraries, like Boost and SDL. After
I'm just learning about dynamic memory allocation, but there is one thing i'd like
Is there a way just like multidatatrigger behavior of WPF also implemented in Silverlight
I know I can call it whatever, but just like there is a convention
I'm just learning MySQL - is there a way to combine (or nest) aggregate
Just learning WPF databinding and have a gap in my understanding. I've seen a
I'm just learning Git and there is something I can't work out. After creating
It's probably something really simple, but I'm just learning. There's a page with 3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.