Skip to content

Commit

Permalink
added PanelGrid demo
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanrauh committed Mar 11, 2015
1 parent 3b54a9a commit 8cb3ac7
Show file tree
Hide file tree
Showing 12 changed files with 284 additions and 27 deletions.
8 changes: 8 additions & 0 deletions PanelGrid/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/target/
rebel.xml
.metadata
.settings
dist
.faces-config.xml.jsfdia
.project
.classpath
12 changes: 12 additions & 0 deletions PanelGrid/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# BootsFaces-Examples: PanelGrid, PrimeFaces and AngularFaces
This demo shows how to set up a BootsFaces project using both PrimeFaces and AngularFaces. Along the way, it demonstrates
the BootsFaces panel grid.

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

Tested on:
<ul>
<li>Tomcat 8.0 / Oracle Mojarra 2.2.10</li>
<li>Tomcat 8.0 / Apache MyFaces 2.2.7</li>
<li>WildFly 8.2</li>
</ul>
103 changes: 103 additions & 0 deletions PanelGrid/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<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>BootsFacesPanelGrid</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>BootsFacesPanelGrid</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.6.5</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.1</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>de.beyondjava</groupId>
<artifactId>angularFaces-core</artifactId>
<version>2.1.2</version>
</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.10</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.10</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,34 @@
package de.beyondjava.bootsfaces.examples;

import java.util.Date;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

@ViewScoped
@ManagedBean
public class Person {

private String firstName;
private String lastName;
private Date birthdate;
public Date getBirthdate() {
return birthdate;
}
public void setBirthdate(Date birthdate) {
this.birthdate = birthdate;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}

}
8 changes: 8 additions & 0 deletions PanelGrid/src/main/webapp/WEB-INF/faces-config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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">

</faces-config>
23 changes: 23 additions & 0 deletions PanelGrid/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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>javax.faces.FACELETS_DECORATORS</param-name>
<param-value>
de.beyondjava.angularFaces.core.tagTransformer.AngularTagDecorator
</param-value>
</context-param>
<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>
46 changes: 46 additions & 0 deletions PanelGrid/src/main/webapp/index.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:b="http://bootsfaces.net/ui" xmlns:f="http://java.sun.com/jsf/core" xmlns:prime="http://primefaces.org/ui">

<h:head>
<style>
.nav-tabs>li.active>a, .nav-tabs>li.active>a:hover, .nav-tabs>li.active>a:focus
{
background-color: #ddd !important;
}
</style>
</h:head>
<h:body>
<b:container >
<b:tabView>
<b:tab title="PrimeFaces" addLabels="false" addMessages="false">
<b:panel title="Contact information" look="info">
<h:form prependId="false" >
<b:panelGrid colSpans="2,3,7" size="xs">
<prime:outputLabel value="First name" for="@next" />
<prime:inputText value="#{person.firstName}" />
<prime:message for="@previous" />
<prime:outputLabel value="Last name" for="@next" />
<prime:inputText value="#{person.lastName}" />
<prime:message for="@previous" />
<prime:outputLabel value="Birthdate" for="@next" />
<prime:calendar value="#{person.birthdate}" />
<prime:message for="@previous" />
</b:panelGrid>
</h:form>
</b:panel>
</b:tab>
<b:tab title="PrimeFaces + AngularFaces">
<b:panel title="Contact information" look="info">
<h:form prependId="false" >
<b:panelGrid colSpans="2,3,7" size="xs">
<prime:inputText value="#{person.firstName}" />
<prime:inputText value="#{person.lastName}" />
<prime:calendar value="#{person.birthdate}" />
</b:panelGrid>
</h:form>
</b:panel>
</b:tab>
</b:tabView>
</b:container>
</h:body>
</html>
3 changes: 2 additions & 1 deletion ResponsiveDesign/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# BootsFaces-Examples: Responsive Design
This demo shows how to set up a BootsFaces project and demonstrates the responsive design.

Run this as a Tomcat application. The URL to start typically is http://localhost:8080/BootsFacesResponsiveDesign
Run this as a Tomcat application. The URL to start typically is http://localhost:8080/BootsFacesResponsiveDesign.
There's also a live demo at http://angularfaces.net/BootsFacesResponsiveDesign/.

Tested on:
<ul>
Expand Down
2 changes: 1 addition & 1 deletion ResponsiveDesign/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<dependency>
<groupId>net.bootsfaces</groupId>
<artifactId>bootsfaces</artifactId>
<version>0.7.0-SNAPSHOT</version>
<version>0.6.5</version>
</dependency>
</dependencies>
<profiles>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package de.beyondjava.bootsfaces.examples;

import java.util.Date;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

@ViewScoped
@ManagedBean
public class Person {

private String firstName;
private String lastName;
private Date birthdate;
public Date getBirthdate() {
return birthdate;
}
public void setBirthdate(Date birthdate) {
this.birthdate = birthdate;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}

}
13 changes: 12 additions & 1 deletion ResponsiveDesign/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
<?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">
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>javax.faces.FACELETS_DECORATORS</param-name>
<param-value>
de.beyondjava.angularFaces.core.tagTransformer.AngularTagDecorator
</param-value>
</context-param>
<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>
Expand Down
25 changes: 1 addition & 24 deletions ResponsiveDesign/src/main/webapp/index.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,5 @@
</b:tab>
</b:tabView>
</b:container>
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push([ 'trackPageView' ]);
_paq.push([ 'enableLinkTracking' ]);
(function() {
var u = "//www.atapuerca.de/piwik/";
_paq.push([ 'setTrackerUrl', u + 'piwik.php' ]);
_paq.push([ 'setSiteId', 4 ]);
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.type = 'text/javascript';
g.async = true;
g.defer = true;
g.src = u + 'piwik.js';
s.parentNode.insertBefore(g, s);
})();
</script>
<noscript>
<p>
<img src="//www.atapuerca.de/piwik/piwik.php?idsite=4" style="border: 0;" alt="" />
</p>
</noscript>
<!-- End Piwik Code -->
</h:body>
</h:body>
</html>

0 comments on commit 8cb3ac7

Please sign in to comment.