Skip to content

Commit 8cdca38

Browse files
committed
📝 add Actions Group documentation
fix #70
1 parent 91f2176 commit 8cdca38

File tree

3 files changed

+94
-1
lines changed

3 files changed

+94
-1
lines changed

docs/images/action.png

23.1 KB
Loading

docs/images/actionsGroup.png

26 KB
Loading

docs/index.md

+94-1
Original file line numberDiff line numberDiff line change
@@ -337,4 +337,97 @@ public class DemoForm implements Serializable {
337337

338338
6- Demo Index
339339

340-
![Demo Index](images/index.png)
340+
![Demo Index](images/index.png)
341+
342+
### Action
343+
344+
Actions are crucial in form screens. To add an action to your form, you have to use the [@Action](../src/main/java/io/asfjava/ui/core/form/Action.java) annotation.
345+
346+
| Properties | Type | Usage |
347+
| ------------- |:-------------: | :-----|
348+
| type | String | The action type |
349+
| title | String | The action title |
350+
| onClick | String | The client side function to fire when clicking on the tab |
351+
352+
The example below demonstrate how to use Action annotation.
353+
354+
```Java
355+
356+
import java.io.Serializable;
357+
358+
import io.asfjava.ui.core.form.Action;
359+
import io.asfjava.ui.core.form.TextField;
360+
361+
@Action(title = "Previous", type = "button", onClick = "goToPrevious()")
362+
@Action(title = "Next", type = "button", onClick = "goToNext()")
363+
public class DemoForm implements Serializable {
364+
365+
@TextField(title = "Full Name")
366+
private String fullName;
367+
368+
@TextField(title = "Email", pattern = "^\\S+@\\S+$")
369+
private String mail;
370+
371+
public String getMail() {
372+
return mail;
373+
}
374+
375+
public String getFullName() {
376+
return fullName;
377+
}
378+
379+
}
380+
381+
382+
```
383+
384+
6- Demo Action
385+
386+
![Demo Action](images/action.png)
387+
388+
### ActionGroup
389+
390+
Developer have the ability to group Actions. To add a group of actions to your form, you have to use the [@ActionsGroup](../src/main/java/io/asfjava/ui/core/form/ActionsGroup.java) annotation.
391+
392+
| Properties | Type | Usage |
393+
| ------------- |:-------------: | :-----|
394+
| value | Array of [@Action](../src/main/java/io/asfjava/ui/core/form/Action.java)| Array of actions |
395+
396+
The example below demonstrate how to use ActionsGroup annotation.
397+
398+
```Java
399+
400+
import java.io.Serializable;
401+
402+
import io.asfjava.ui.core.form.Action;
403+
import io.asfjava.ui.core.form.ActionsGroup;
404+
import io.asfjava.ui.core.form.TextField;
405+
406+
@ActionsGroup({
407+
@Action(title = "Previous", type = "button", onClick = "goToPrevious()"),
408+
@Action(title = "Next", type = "button", onClick = "goToNext()")
409+
})
410+
public class DemoForm implements Serializable {
411+
412+
@TextField(title = "Full Name")
413+
private String fullName;
414+
415+
@TextField(title = "Email", pattern = "^\\S+@\\S+$")
416+
private String mail;
417+
418+
public String getMail() {
419+
return mail;
420+
}
421+
422+
public String getFullName() {
423+
return fullName;
424+
}
425+
426+
}
427+
428+
429+
```
430+
431+
6- Demo ActionGroup
432+
433+
![Demo ActionGroup](images/actionsGroup.png)

0 commit comments

Comments
 (0)