Skip to content

Instantly share code, notes, and snippets.

@SakaDream SakaDream/home.xhtml
Created Jul 26, 2017

Embed
What would you like to do?
<?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" xml:lang="en" lang="en"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:b="http://bootsfaces.net/ui">
<h:head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>List of Employees - JSF Application</title>
</h:head>
<h:body style="padding: 60px; min-height: 2000px;">
<b:navBar brand="JSF Example" brandHref="#" fixed="top" inverse="true">
<b:navbarLinks>
<b:form>
<b:commandButton look="default" action="#{login.logout()}" value="Logout"></b:commandButton>
</b:form>
</b:navbarLinks>
</b:navBar>
<b:container>
<h:link outcome="add" styleClass="btn btn-success" style="margin-bottom: 20px" value="Add"/>
<br/>
<h:form id="form">
<b:dataTable value="#{emp.showAllEmployees()}" var="employee">
<b:dataTableColumn value="#{employee.id}" label="ID"/>
<b:dataTableColumn value="#{employee.fullName}" label="Full Name"/>
<b:dataTableColumn value="#{employee.address}" label="Address"/>
<b:dataTableColumn value="#{employee.email}" label="Email"/>
<b:dataTableColumn value="#{employee.phone}" label="Phone"/>
<b:dataTableColumn value="#{employee.salary}" label="Salary"/>
<b:dataTableColumn label="Action">
<h:link outcome="edit" styleClass="glyphicon glyphicon-pencil btn btn-primary" style="margin-right: 10px" value="Edit">
<f:param name="id" value="#{employee.id}"/>
</h:link>
<b:commandButton value="Deiete" look="danger" icon="trash" action="#{emp.deleteEmployee(employee.id)}"
onclick="return confirm('Do you want to remove this employee?')"/>
</b:dataTableColumn>
</b:dataTable>
</h:form>
</b:container>
</h:body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.