Page 1 of 1
Opening a page into a Layout unit
Posted: 12 Apr 2011, 02:18
by mesken
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
Re: Opening a page into a Layout unit
Posted: 12 Apr 2011, 09:52
by oriolvc
Hello
I'm interested too in this subject baecause I'm doing something similar.
I'd appreciate some helps.
Thanks
Re: Opening a page into a Layout unit
Posted: 12 Apr 2011, 10:16
by oriolvc
Re: Opening a page into a Layout unit
Posted: 21 Sep 2011, 11:54
by fihsak
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
Re: Opening a page into a Layout unit
Posted: 21 Sep 2011, 12:12
by Oleg
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
Re: Opening a page into a Layout unit
Posted: 21 Sep 2011, 13:45
by fihsak
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
Re: Opening a page into a Layout unit
Posted: 22 Sep 2011, 09:28
by fihsak
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