Skip to content

Commit

Permalink
LPS-112473 Add containerCssClass prop to the new SelectTag
Browse files Browse the repository at this point in the history
  • Loading branch information
kresimir-coko authored and brianchandotcom committed Nov 18, 2020
1 parent 582bc0b commit 1e59f5d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
Expand Up @@ -111,6 +111,7 @@ for (int i = 0; i < 8; i++) {
%>

<clay:select
containerCssClass="custom-container-css-class"
cssClass="custom-css-class"
id="customId"
label="Regular Select Element"
Expand Down
Expand Up @@ -43,6 +43,10 @@ public int doStartTag() throws JspException {
return super.doStartTag();
}

public String getContainerCssClass() {
return _containerCssClass;
}

public String getLabel() {
return LanguageUtil.get(
TagResourceBundleUtil.getResourceBundle(pageContext), _label);
Expand All @@ -64,6 +68,10 @@ public boolean isMultiple() {
return _multiple;
}

public void setContainerCssClass(String containerCssClass) {
_containerCssClass = containerCssClass;
}

public void setDisabled(boolean disabled) {
_disabled = disabled;
}
Expand All @@ -88,6 +96,7 @@ public void setOptions(List<SelectOption> options) {
protected void cleanUp() {
super.cleanUp();

_containerCssClass = null;
_disabled = false;
_label = null;
_multiple = false;
Expand Down Expand Up @@ -163,7 +172,13 @@ protected int processStartTag() throws Exception {
protected void writeCssClassAttribute() throws Exception {
JspWriter jspWriter = pageContext.getOut();

jspWriter.write(" class=\"form-group\"");
jspWriter.write(" class=\"form-group ");

if (Validator.isNotNull(_containerCssClass)) {
jspWriter.write(_containerCssClass);
}

jspWriter.write("\"");
}

@Override
Expand All @@ -176,6 +191,7 @@ protected void writeIdAttribute() {

private static final String _ATTRIBUTE_NAMESPACE = "clay:select:";

private String _containerCssClass;
private boolean _disabled;
private String _label;
private boolean _multiple;
Expand Down
Expand Up @@ -3504,6 +3504,12 @@
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description></description>
<name>containerCssClass</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>Deprecated as of 7.4.0, with no direct replacement.</description>
<name>contributorKey</name>
Expand Down

0 comments on commit 1e59f5d

Please sign in to comment.