Skip to content

Commit 77fd2ac

Browse files
committed
added an example demonstrating how to put fields, labels, and messages into the same line
1 parent 04dd3e0 commit 77fd2ac

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
package net.bootsfaces.demo.forms;
2+
3+
import java.io.Serializable;
4+
5+
import javax.faces.bean.ManagedBean;
6+
import javax.faces.bean.SessionScoped;
7+
8+
@ManagedBean
9+
@SessionScoped
10+
public class PersonBean implements Serializable {
11+
12+
private static final long serialVersionUID = 1L;
13+
14+
private String firstName = "";
15+
16+
private String lastName = "";
17+
18+
private String zipCode ="";
19+
private String city="";
20+
21+
private String street="";
22+
23+
private String poBox="";
24+
25+
public String getFirstName() {
26+
return firstName;
27+
}
28+
29+
public void setFirstName(String firstName) {
30+
this.firstName = firstName;
31+
}
32+
33+
public String getLastName() {
34+
return lastName;
35+
}
36+
37+
public void setLastName(String lastName) {
38+
this.lastName = lastName;
39+
}
40+
41+
public String getZipCode() {
42+
return zipCode;
43+
}
44+
45+
public void setZipCode(String zipCode) {
46+
this.zipCode = zipCode;
47+
}
48+
49+
public String getCity() {
50+
return city;
51+
}
52+
53+
public void setCity(String city) {
54+
this.city = city;
55+
}
56+
57+
public String getStreet() {
58+
return street;
59+
}
60+
61+
public void setStreet(String street) {
62+
this.street = street;
63+
}
64+
65+
public String getPoBox() {
66+
return poBox;
67+
}
68+
69+
public void setPoBox(String poBox) {
70+
this.poBox = poBox;
71+
}
72+
73+
}

src/main/webapp/test/trinity.xhtml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version='1.0' encoding='UTF-8' ?>
2+
<!DOCTYPE html>
3+
<html xmlns="http://www.w3.org/1999/xhtml"
4+
xmlns:h="http://java.sun.com/jsf/html"
5+
xmlns:f="http://java.sun.com/jsf/core"
6+
xmlns:b="http://bootsfaces.net/ui"
7+
xmlns:ui="http://java.sun.com/jsf/facelets">
8+
9+
<h:head></h:head>
10+
<h:body>
11+
<b:container>
12+
<h1>Field, labels and validations</h1>
13+
<b:form horizontal="true">
14+
<b:row>
15+
<b:formGroup>
16+
<b:inputText label-col-xs="2" col-xs="2" label="First name"
17+
value="#{personBean.firstName}" />
18+
<b:message col-xs="2" for="@previous" />
19+
<b:inputText label-col-xs="2" col-xs="2" label="Last name"
20+
value="#{personBean.lastName}" />
21+
<b:message col-xs="2" for="@previous" />
22+
</b:formGroup>
23+
</b:row>
24+
<b:row>
25+
<b:formGroup>
26+
<b:inputText label-col-xs="2" col-xs="2" label="Zip code"
27+
value="#{personBean.zipCode}" />
28+
<b:message col-xs="2" for="@previous" />
29+
<b:inputText label-col-xs="2" col-xs="2" label="City"
30+
value="#{personBean.city}" />
31+
<b:message col-xs="2" for="@previous" />
32+
</b:formGroup>
33+
</b:row>
34+
</b:form>
35+
</b:container>
36+
</h:body>
37+
</html>

0 commit comments

Comments
 (0)