Skip to content

Commit 4d47e50

Browse files
committed
📝 add @tab wiki
1 parent 0beeea9 commit 4d47e50

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

docs/images/tab.png

29.8 KB
Loading

docs/index.md

+51
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,54 @@ public class DemoForm implements Serializable {
234234

235235
![Demo TextArea](images/textArea.png)
236236

237+
### Tabs
238+
239+
Tabs organize content into separate views where only one view can be visible at a time. To use a this component the developer must use [@Tab](../src/main/java/io/asfjava/ui/core/form/Tab.java). The idea is to allow the developer mark which component will be in a specific tab. The properties below must be filled by the developer to render the Tab.
240+
241+
| Properties | Type | Usage |
242+
| ------------- |:-------------: | :-----|
243+
| title | String | The title of the Tab |
244+
| index | Integer | The tab index. In most case, there more than one tab in the screen |
245+
246+
The example below demonstrate how to use Tab annotation.
247+
248+
```Java
249+
250+
import java.io.Serializable;
251+
252+
import io.asfjava.ui.core.form.Tab;
253+
import io.asfjava.ui.core.form.TextField;
254+
255+
public class DemoForm implements Serializable {
256+
257+
@Tab(title = "First tab", index = 0)
258+
@TextField(title = "Full Name", minLenght = 3)
259+
private String fullName;
260+
261+
@Tab(title = "Second tab", index = 1)
262+
@TextField(title = "Email", pattern = "^\\S+@\\S+$")
263+
private String mail;
264+
265+
@Tab(title = "First tab", index = 0)
266+
@TextField(title = "Repository", fieldAddonLeft = "https://github.com/")
267+
private String githubRepository;
268+
269+
public String getMail() {
270+
return mail;
271+
}
272+
273+
public String getFullName() {
274+
return fullName;
275+
}
276+
277+
public String getGithubRepository() {
278+
return githubRepository;
279+
}
280+
281+
}
282+
283+
```
284+
285+
5- Demo Tab
286+
287+
![Demo Tab](images/tab.png)

0 commit comments

Comments
 (0)