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 7895049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:32:53+00:00 2026-06-03T07:32:53+00:00

I am using primefaces 3.1 with `, having four positions. In the west position(west)

  • 0

I am using primefaces 3.1 with `, having four positions.
In the west position(west) I have added tree menu. JSF code is follows

<p:layoutUnit position="west" size="200" header="Left"
            resizable="true" collapsible="true">
            <h:form>
                <p:tree dynamic="true" value="#{treeBean.root}" var="node" id="tree"
                    selectionMode="single">
                    <p:treeNode id="treeNode">
                        <h:outputText value="#{node}" id="lblNode" />
                    </p:treeNode>
                </p:tree>
            </h:form>
        </p:layoutUnit>

and in the TreeBean I have

root = new DefaultTreeNode("Root", null);  
        TreeNode node0 = new DefaultTreeNode("Color", root);  


        TreeNode node00 = new DefaultTreeNode("Red", node0);  
        TreeNode node01 = new DefaultTreeNode("Blue", node0);
        TreeNode node02 = new DefaultTreeNode("Green", node0);

Is it possible to have navigation when I expand and click one of those nodes and upon clicking respective nodes how could I display jsf pages in the center position of layout. i.e. if I click node Blue, ideally I would like to have another jsf page being loaded into the center position of layout.

Any help is highly appreciable.

Thanks

Update 1

I have added the following code and it does a navigation to start.xhtml. However start.xhtml is displayed not inside my layout, start.xhtml is displayed as a new page.

public void onNodeSelect(NodeSelectEvent event) {

        try {
            System.out.println(" here " + event.getTreeNode().getData());
            FacesContext
                    .getCurrentInstance()
                    .getApplication()
                    .getNavigationHandler()
                    .handleNavigation(FacesContext.getCurrentInstance(),
                            "null", "/start.xhtml?faces-redirect=true");
        } catch (Exception e) {
            logger.info("error "+e.getMessage());
            // TODO: handle exception
        } 
  • 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-06-03T07:32:54+00:00Added an answer on June 3, 2026 at 7:32 am

    I think that this post will be very useful for you Include one xhtml inside another JSF

    It describes how you create a template and then use it in your template client. @rags already told you that, but you don’t really have to use <p:layout>. Article linked above is just more precise. I believe you will find what you need there. Regards

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

Sidebar

Related Questions

I have the jsf code and css code below. I'm having trouble getting the
Im having some problems with redirections. Im using primefaces and JSF 2.1. The thing
I´m having some trouble implementing a dynamic tree structure using the primefaces tree implementation.
Hi there Im just learning JSF 2 using Primefaces. I have a question regarding
I have an application developed using Primefaces 2.2.1 and JSF 2.0, deployed on Glassfish
I recently migrated my JSF app(using primefaces) from glassfish 3.1 to tomcat7 server. Previously
I'm using this jQuery snippet to create tooltips on some JSF primefaces elements in
I am working with MyFaces/Primefaces and I have a problem to get information using
I'm using primefaces' accordion panel. Inside the tabs i have forms which are created
I have a modal ConfirmDialog that is shown over a modal Dialog using PrimeFaces

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.