Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanrauh committed Sep 16, 2015
1 parent 61eb535 commit c374d4f
Show file tree
Hide file tree
Showing 11 changed files with 292 additions and 0 deletions.
9 changes: 9 additions & 0 deletions PrimeFacesLayout/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/target/
rebel.xml
.metadata
.settings
dist
.faces-config.xml.jsfdia
.project
.classpath
.DS_Store
10 changes: 10 additions & 0 deletions PrimeFacesLayout/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# BootsFaces-Examples: AJAX
This demo shows how to use the PrimeFaces layout with BootsFaces.
Also see http://stackoverflow.com/questions/32599781/jsf-primefaces-and-bootsfaces.

Run this as a Tomcat application. The URL to start typically is http://localhost:8080/BootsFacesPrimeFacesLayout.

Tested on:
<ul>
<li>Tomcat 8.0 / Oracle Mojarra 2.2.10</li>
</ul>
112 changes: 112 additions & 0 deletions PrimeFacesLayout/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.beyondjava</groupId>
<artifactId>BootsFacesPrimeFacesLayout</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>BootsFacesPrimeFacesLayout</name>
<url>http://www.beyondjava.net</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.bootsfaces</groupId>
<artifactId>bootsfaces</artifactId>
<version>0.7.0</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>bootstrap</artifactId>
<version>1.0.10</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>1.10</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>


</dependencies>
<profiles>
<profile>
<id>ApplicationServer</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.10</version>
<scope>provided</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>Mojarra</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.12</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.12</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>MyFaces</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
<version>2.2.7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
<version>2.2.7</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package de.beyondjava.bootsfaces.examples;
import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

@ManagedBean
@SessionScoped
public class Sobean implements Serializable{
private String page="page0";
public void page0() {
page="page0";
}
public void page1() {
page="page1";
}
public void page2() {
page="page2";
}
public void page3() {
page="page3";
}
public String getPage() {
return page;
}
public void setPage(String page) {
this.page = page;
}

}
12 changes: 12 additions & 0 deletions PrimeFacesLayout/src/main/webapp/WEB-INF/faces-config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
<application>
<resource-handler>org.omnifaces.resourcehandler.CombinedResourceHandler
</resource-handler>
</application>

</faces-config>
18 changes: 18 additions & 0 deletions PrimeFacesLayout/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">

<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>bootstrap</param-value>
</context-param>

<context-param>
<param-name>BootsFaces_USETHEME</param-name>
<param-value>true</param-value>
</context-param>
<welcome-file-list>
<welcome-file>index.jsf</welcome-file>
</welcome-file-list>
</web-app>
51 changes: 51 additions & 0 deletions PrimeFacesLayout/src/main/webapp/index.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:bnu="http://bootsfaces.net/ui">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>PrimeFaces layout component and BootsFaces panels</title>
</h:head>
<h:body>
<p:layout fullPage="true">

<p:layoutUnit position="north" size="100" resizable="false" closable="false" collapsible="false" >
<h3>PrimeFaces layout component and BootsFaces panels (and PrimeFaces AJAX)</h3>

</p:layoutUnit>


<p:layoutUnit position="west" size="195" header="Panel" resizable="true" closable="false" collapsible="true" >
<h:form id="form" >

<p:menu>
<p:menuitem id="abc" value="Welcome page" action="#{sobean.page0()}" update=":content:pcenter" />
<p:submenu label="ABC" >
<p:menuitem id="X1" value="Name" action="#{sobean.page1()}" update=":content:pcenter"/>
<p:menuitem id="X2" value="Street" action="#{sobean.page2()}" update=":content:pcenter"/>
<p:menuitem id="X3" value="City" action="#{sobean.page3()}" update=":content:pcenter"/>
</p:submenu>
</p:menu>

</h:form>
</p:layoutUnit>

<p:layoutUnit position="center" header="Welcome user" >
<h:form id="content">
<p:panel id="pcenter">
<ui:include src="#{sobean.page}.xhtml" />
</p:panel>
</h:form>
</p:layoutUnit>

<p:layoutUnit position="south" size="100" header="Bottom" resizable="false" closable="false" collapsible="false">
<h:outputText value="South unit content." />
</p:layoutUnit>

</p:layout>
</h:body>
</html>
11 changes: 11 additions & 0 deletions PrimeFacesLayout/src/main/webapp/page0.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:bnu="http://bootsfaces.net/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core">

<bnu:panel id="pdata" title="Getting started" collapsible="true" look="info">
<h3>Welcome!</h3>
<p>In the next three steps, you can enter your name, the street and the city you live in. Just click the three consecutive menu items.</p>
</bnu:panel>
</html>
13 changes: 13 additions & 0 deletions PrimeFacesLayout/src/main/webapp/page1.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:bnu="http://bootsfaces.net/ui"
xmlns:ui="http://java.sun.com/jsf/facelets">

<bnu:panel id="pdata" title="User data 1" collapsible="true" look="primary">
<p:outputLabel value="Name" for="txt_name" />
<p:inputText id="txt_name" label="Name" required="true">
</p:inputText>
</bnu:panel>
</ui:composition>
13 changes: 13 additions & 0 deletions PrimeFacesLayout/src/main/webapp/page2.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:bnu="http://bootsfaces.net/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core">

<head>
</head>
<bnu:panel id="pdata" title="User data 2" collapsible="true" look="primary">
<bnu:inputText id="txt_name" label="Street" required="true">
</bnu:inputText>
</bnu:panel>
</html>
13 changes: 13 additions & 0 deletions PrimeFacesLayout/src/main/webapp/page3.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<ui:fragment xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:bnu="http://bootsfaces.net/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">

<bnu:panel id="pdata" title="User data 3" collapsible="true" look="success">
<bnu:inputText id="txt_name" label="City" required="true">
</bnu:inputText>
</bnu:panel>

</ui:fragment>

0 comments on commit c374d4f

Please sign in to comment.