Skip to content

Patch 1.0.2 #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ To render a field as a TextField the developer must add the [@TextField](../src/
| pattern | String (regEx) | Reg Ex used to validate the input |
| validationMessage | String | A custom validation error message |
| readOnly | Boolean | Make the field readOnly |
| required | Boolean | Make the field required |
| noTitle | Boolean | Set to true to hide title |
| fieldAddonLeft | String | [Extend form controls](http://getbootstrap.com/components/#input-groups) by adding text on the left side of the Text Field |
| fieldAddonRight | String | [Extend form controls](http://getbootstrap.com/components/#input-groups) by adding text on the right side of the Text Field |
Expand Down Expand Up @@ -81,6 +82,7 @@ The given component can be used to fill numeric values, it can be applied to fie
| description | String | A description, can be HTML |
| validationMessage | String | A custom validation error message |
| readOnly | Boolean | Make the field readOnly |
| required | Boolean | Make the field required |
| noTitle | Boolean | Set to true to hide title |
| fieldAddonLeft | String | [Extend form controls](http://getbootstrap.com/components/#input-groups) by adding text on the left side of the Number Field |
| fieldAddonRight | String | [Extend form controls](http://getbootstrap.com/components/#input-groups) by adding text on the right side of the Number Field |
Expand Down Expand Up @@ -147,6 +149,7 @@ For some use cases, the developer need to use a encrypted UI input field to fill
| pattern | String (regEx) | Reg Ex used to validate the input |
| validationMessage | String | A custom validation error message |
| readOnly | Boolean | Make the field readOnly |
| required | Boolean | Make the field required |
| noTitle | Boolean | Set to true to hide title |
| fieldAddonLeft | String | [Extend form controls](http://getbootstrap.com/components/#input-groups) by adding text on the left side of the Password Field |
| fieldAddonRight | String | [Extend form controls](http://getbootstrap.com/components/#input-groups) by adding text on the right side of the Password Field |
Expand Down Expand Up @@ -190,6 +193,7 @@ The TextArea component is a multiline text field with a border and optional scro
| maxLength | Integer | Max text length |
| validationMessage | String | A custom validation error message |
| readOnly | Boolean | Make the field readOnly |
| required | Boolean | Make the field required |
| noTitle | Boolean | Set to true to hide title |
| fieldAddonLeft | String | [Extend form controls](http://getbootstrap.com/components/#input-groups) by adding text on the left side of the Text Area |
| fieldAddonRight | String | [Extend form controls](http://getbootstrap.com/components/#input-groups) by adding text on the right side of the Text Area |
Expand Down
18 changes: 0 additions & 18 deletions release.properties

This file was deleted.

3 changes: 3 additions & 0 deletions src/main/java/io/asfjava/ui/core/form/Number.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@
String validationMessage() default "";

boolean readOnly() default false;

boolean required() default false;

}
3 changes: 3 additions & 0 deletions src/main/java/io/asfjava/ui/core/form/Password.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@
String validationMessage() default "";

boolean readOnly() default false;

boolean required() default false;

}
2 changes: 2 additions & 0 deletions src/main/java/io/asfjava/ui/core/form/RadioBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
String title();

boolean readOnly() default false ;

boolean required() default false;

Class<? extends ValuesContainer> titleMap();

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/io/asfjava/ui/core/form/TextArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@
String validationMessage() default "";

boolean readOnly() default false;

boolean required() default false;
}
3 changes: 3 additions & 0 deletions src/main/java/io/asfjava/ui/core/form/TextField.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@
String validationMessage() default "";

boolean readOnly() default false;

boolean required() default false;

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public void generate(ObjectNode fieldFormDefinition, Field field) {
Number annotation = field.getAnnotation(Number.class);
fieldFormDefinition.put("key", field.getName());
fieldFormDefinition.put("type", "number");
fieldFormDefinition.put("required", annotation.required());

String title = annotation.title();
if (!title.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public void generate(ObjectNode fieldFormDefinition, Field field) {
Password annotation = field.getAnnotation(Password.class);
fieldFormDefinition.put("key", field.getName());
fieldFormDefinition.put("type", "password");
fieldFormDefinition.put("required", annotation.required());

String description = annotation.description();
if (!description.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public void generate(ObjectNode fieldFormDefinition, Field field) {
fieldFormDefinition.put("key", field.getName());
fieldFormDefinition.put("readOnly", annotation.readOnly());
fieldFormDefinition.put("type", "radios");
fieldFormDefinition.put("required", annotation.required());

JsonNode radioFieldFormDefinition = fieldFormDefinition;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public void generate(ObjectNode fieldFormDefinition, Field field) {
TextArea annotation = field.getAnnotation(TextArea.class);
fieldFormDefinition.put("key", field.getName());
fieldFormDefinition.put("type", "textarea");
fieldFormDefinition.put("required", annotation.required());

String fieldAddonLeft = annotation.fieldAddonLeft();
if (!fieldAddonLeft.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public void generate(ObjectNode fieldFormDefinition, Field field) {
TextField annotation = field.getAnnotation(TextField.class);

fieldFormDefinition.put("key", field.getName());
fieldFormDefinition.put("required", annotation.required());

String description = annotation.description();
if (!description.isEmpty()) {
fieldFormDefinition.put("description", description);
Expand Down