Skip to content

Commit

Permalink
Merge branch 'blv-T2229560-validation' into blv-master
Browse files Browse the repository at this point in the history
  • Loading branch information
mamo committed Jan 17, 2025
2 parents 809135a + 51599c0 commit aa9aec2
Showing 1 changed file with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,8 @@ private class BuilderData<V> {

protected Boolean m_mandatory;

protected Boolean m_mandatoryIcon;

@Nullable
protected String m_controlCss;

Expand Down Expand Up @@ -588,7 +590,7 @@ public BuilderData(PropertyMetaModel<V> propertyMetaModel) {
}
}
}
if(res != null && calculateMandatory() && !isReadOnly()) {
if(res != null && ((calculateMandatory() && !isReadOnly()) || isMandatoryIconOn())) {
res.addCssClass("ui-f4-mandatory");
}

Expand All @@ -606,6 +608,14 @@ private boolean calculateMandatory() {
return false;
}

private boolean isMandatoryIconOn() {
Boolean m = m_mandatoryIcon;
if(null != m) {
return m;
}
return false;
}

@Nullable
private String labelTextCalculated() {
String txt = m_nextLabel;
Expand Down Expand Up @@ -719,6 +729,12 @@ public ItemBuilder mandatory(boolean yes) {
return this;
}

@NonNull
public ItemBuilder addMandatoryIcon(boolean yes) {
m_mandatoryIcon = Boolean.valueOf(yes);
return this;
}

@NonNull
public ItemBuilder readOnly() {
m_readOnly = Boolean.TRUE;
Expand Down Expand Up @@ -1063,6 +1079,12 @@ public UntypedControlBuilder<I> mandatory(boolean yes) {
return this;
}

@NonNull
public UntypedControlBuilder<I> addMandatoryIcon(boolean yes) {
m_mandatoryIcon = Boolean.valueOf(yes);
return this;
}

@NonNull
public UntypedControlBuilder<I> errorLocation(@NonNull String errorLocation) {
m_errorLocation = errorLocation;
Expand Down

0 comments on commit aa9aec2

Please sign in to comment.