Skip to content

Commit 91f2176

Browse files
committed
📝 add @Index wiki
1 parent 4d47e50 commit 91f2176

File tree

3 files changed

+55
-2
lines changed

3 files changed

+55
-2
lines changed

demo/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<dependency>
3939
<groupId>io.sfjava.ui</groupId>
4040
<artifactId>sf-java-ui</artifactId>
41-
<version>0.1.0</version>
41+
<version>1.0.0</version>
4242
</dependency>
4343
</dependencies>
4444

docs/images/index.png

18.6 KB
Loading

docs/index.md

+54-1
Original file line numberDiff line numberDiff line change
@@ -284,4 +284,57 @@ public class DemoForm implements Serializable {
284284

285285
5- Demo Tab
286286

287-
![Demo Tab](images/tab.png)
287+
![Demo Tab](images/tab.png)
288+
289+
### Index
290+
291+
Having the ability to handle the fields order in the screen is very important for developers, this is why we added an [@Index](../src/main/java/io/asfjava/ui/core/form/Index.java) annotation that allow you to mark the index of your field in the rendered screen.
292+
293+
N.B: The [@Index](../src/main/java/io/asfjava/ui/core/form/Index.java) annotation also used with [@Tab](../src/main/java/io/asfjava/ui/core/form/Tab.java) annotation. It handle the order of components into the tab rendered
294+
295+
| Properties | Type | Usage |
296+
| ------------- |:-------------: | :-----|
297+
| value | Integer | The value of the index |
298+
299+
The example below demonstrate how to use Index annotation.
300+
301+
```Java
302+
303+
import java.io.Serializable;
304+
305+
import io.asfjava.ui.core.form.Index;
306+
import io.asfjava.ui.core.form.TextField;
307+
308+
public class DemoForm implements Serializable {
309+
310+
@Index(3)
311+
@TextField(title = "Full Name")
312+
private String fullName;
313+
314+
@Index(1)
315+
@TextField(title = "Email", pattern = "^\\S+@\\S+$")
316+
private String mail;
317+
318+
@Index(2)
319+
@TextField(title = "Repository", fieldAddonLeft = "https://github.com/")
320+
private String githubRepository;
321+
322+
public String getMail() {
323+
return mail;
324+
}
325+
326+
public String getFullName() {
327+
return fullName;
328+
}
329+
330+
public String getGithubRepository() {
331+
return githubRepository;
332+
}
333+
334+
}
335+
336+
```
337+
338+
6- Demo Index
339+
340+
![Demo Index](images/index.png)

0 commit comments

Comments
 (0)