Opening a page into a Layout unit

Components, Ajax Framework, Utilities and More.
Post Reply
mesken
Posts: 68
Joined: 27 Mar 2011, 02:53

12 Apr 2011, 02:18

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

oriolvc
Posts: 3
Joined: 12 Apr 2011, 09:48

12 Apr 2011, 09:52

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

oriolvc
Posts: 3
Joined: 12 Apr 2011, 09:48

12 Apr 2011, 10:16

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

http://primefaces.prime.com.tr/forum/vi ... ter#p10643
PrimeFaces 3.1 , Mojarra 2.1.2, Apache Tomcat 7, Spring 3, Hibernate 3, Windows 7

fihsak
Posts: 9
Joined: 21 Sep 2011, 11:47

21 Sep 2011, 11:54

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

User avatar
Oleg
Expert Member
Posts: 3788
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

21 Sep 2011, 12:12

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

fihsak
Posts: 9
Joined: 21 Sep 2011, 11:47

21 Sep 2011, 13:45

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.

Code: Select all

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

Code: Select all

<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

Code: Select all

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

fihsak
Posts: 9
Joined: 21 Sep 2011, 11:47

22 Sep 2011, 09:28

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

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 4 guests