Skip to content

Commit

Permalink
Add support for NotBlank annotation
Browse files Browse the repository at this point in the history
Fix #738
  • Loading branch information
NicolaIsotta committed Apr 28, 2017
1 parent 8662104 commit deac4d6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/net/bootsfaces/render/CoreRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ public String getErrorAndRequiredClass(UIInput input, String clientId) {
if (null != readAnnotations && readAnnotations.length > 0) {
for (Annotation a : readAnnotations) {
if ((a.annotationType().getName().endsWith("NotNull"))
|| (a.annotationType().getName().endsWith("NotEmpty"))) {
|| (a.annotationType().getName().endsWith("NotEmpty"))
|| (a.annotationType().getName().endsWith("NotBlank"))) {
styleClass += " bf-required";
break;
}
Expand All @@ -204,7 +205,7 @@ protected boolean shouldRenderAttribute(Object value) {
return false;

if (value instanceof Boolean) {
return ((Boolean) value).booleanValue();
return ((Boolean) value);
} else if (value instanceof Number) {
Number number = (Number) value;

Expand Down Expand Up @@ -242,7 +243,7 @@ protected void decodeBehaviors(FacesContext context, UIComponent component) {

if (behaviorsForEvent != null && !behaviorsForEvent.isEmpty()) {
String behaviorSource = params.get("javax.faces.source");
String clientId = component.getClientId();
String clientId = component.getClientId(context);
if (behaviorSource != null && clientId.equals(behaviorSource)) {
for (ClientBehavior behavior : behaviorsForEvent) {
behavior.decode(context, component);
Expand Down

0 comments on commit deac4d6

Please sign in to comment.