Skip to content

Commit 916abd4

Browse files
committed
2 parents 98b7b81 + b2a8ae9 commit 916abd4

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

docs/index.md

+40
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,46 @@ To render a field as a TextField the developer must add the [@TextField](../src/
2424
| fieldAddonLeft | String | [Extend form controls](http://getbootstrap.com/components/#input-groups) by adding text on the left side of the Text Field |
2525
| fieldAddonRight | String | [Extend form controls](http://getbootstrap.com/components/#input-groups) by adding text on the right side of the Text Field |
2626

27+
The code below is an example using the TextField annotation. Feel free to try this code snipet:
28+
29+
```Java
30+
import java.io.Serializable;
31+
32+
import io.asfjava.ui.core.form.TextField;
33+
34+
public class DemoForm implements Serializable {
35+
36+
@TextField(title = "Full Name", minLenght = 3)
37+
private String fullName;
38+
39+
@TextField(title = "Email", pattern = "^\\S+@\\S+$")
40+
private String mail;
41+
42+
@TextField(title = "Repository", fieldAddonLeft = "https://github.com/")
43+
private String githubRepository;
44+
45+
@TextField(title = "Github user name", fieldAddonRight = "@Github.com")
46+
private String githubUserName;
47+
48+
public String getMail() {
49+
return mail;
50+
}
51+
52+
public String getFullName() {
53+
return fullName;
54+
}
55+
56+
public String getGithubRepository() {
57+
return githubRepository;
58+
}
59+
60+
public String getGithubUserName() {
61+
return githubUserName;
62+
}
63+
}
64+
65+
```
66+
2767
### NumberField:
2868

2969
The given component can be used to fill numeric values, it can be applied to fields of type [java.lang.Number](https://docs.oracle.com/javase/7/docs/api/java/lang/Number.html) (Integer, Long, Double, Float, etc ...). The developer must use the [@Number](../src/main/java/io/asfjava/ui/core/form/Number.java) in this case.

0 commit comments

Comments
 (0)