Board index JavaServer Faces General Opening a page into a Layout unit

Opening a page into a Layout unit

Components, Ajax Framework, Utilities and More.


Posts: 68
Please I have a Layout with North, East, West and Center and I have a menu on my left, I don't know to make it in such a way that when I click on one menu or link, the page should open on the centre unit
Eclipse Helios 3.6 | Glassfish 3.1 | PrimeFaces 2.2.1


Posts: 3
Hello
I'm interested too in this subject baecause I'm doing something similar.
I'd appreciate some helps.

Thanks
PrimeFaces 3.1 , Mojarra 2.1.2, Apache Tomcat 7, Spring 3, Hibernate 3, Windows 7


Posts: 3
I answer mysel: I found a post where it's explained:

viewtopic.php?f=3&t=2194&p=10643&hilit=layout+menu+center#p10643
PrimeFaces 3.1 , Mojarra 2.1.2, Apache Tomcat 7, Spring 3, Hibernate 3, Windows 7


Posts: 9
Hi oriolvc,
I am new on prime faces. Working for same thing with tree that, If user click on any node, the corresponding xhtml page should be opened/displayed in center layout unit.
Here your provided link is dead, can you please help me for completing this task.

Regards
fihsak

Oleg User avatar
Expert Member

Posts: 3696
Location: Russia, Siberia => Germany, Black Forest
Hi,

This is a typically use case. There are many posts about that. You can use either "rendered" attribute or dynamically ui:include. But be aware of issue with ui:include viewtopic.php?f=3&t=14997
PrimeFaces 4.x, 5.x, Mojarra 2.2.x, JBoss WildFly, WebSphere, Windows 8.1, IntelliJ IDEA
PrimeFaces Cookbook: http://ova2.github.com/primefaces-cookbook/ PrimeFaces Extensions on GitHub: http://primefaces-extensions.github.com/


Posts: 9
Hi,
I had checked it, but having problem to set value of variable using actionListener as method is not being identifying and EClips throws exception
i-e.
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

descriptionThe server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: EL Expression Unbalanced: ... #{test.setURL('firstpanel')" update = ":main" ><h:outputText value="Test Link"/></h:outputLink>
root cause

javax.el.ELException: EL Expression Unbalanced: ... #{test.setURL('firstpanel')" update = ":main" ><h:outputText value="Test Link"/></h:outputLink>
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.1 logs.


--------------------------------------------------------------------------------

GlassFish Server Open Source Edition 3.1.1


kindly check my code below and comment:

test.html.xhtml
<html xmlns="http://www.w3c.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.prime.com.tr/ui"
    xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
</h:head>
<h:body>
<p:layout fullPage="true">
   <p:layoutUnit id="top" position="top" height="110" resizable="false" closable="false" collapsible="false" style = "text-align:center">
      <p:graphicImage value="/images/mcb.jpg" position = "middle" />
   </p:layoutUnit>
   <p:layoutUnit id="left" position="left" width="200" minWidth="200" maxWidth="300" resizable="true" closable="false" collapsible="true">
      <h:form>
         <p:commandLink actionListener="#{test.setURL('firstpanel')}" update = ":main" ><h:outputText value="Test Link"/></p:commandLink>
      </h:form>
   </p:layoutUnit>
   <p:layoutUnit id="main" position="center" resizable="true" closable="false" collapsible="true">
      <ui:include src="#{test.url}" />
   </p:layoutUnit>   
</p:layout>
</h:body>
</html>


test.java
public class test{
   private TreeNode root;
   private String url = "I am test";

   public String getUrl() {
      return url;
   }

   public void setUrl(String url) {
      this.url = url;
   }
}

Java file is adde in managed beans on session in faces-config.xml

Thanks & Regards
fihsak


Posts: 9
Hi,
I am here to tell you that my problem is solved. It seems issue with JDK 6, I just reinstall JDK and then everything is fine. It's obvious but its true.

Thanks & Regards
fihsak


Return to General