Something weird is happening to all the dropdowns on my website, when there is validation error all the inputs, except the h:selectOneMenu
, gets this css class "ui-state-error". I need to set this css class so I can display the dropdown with a red border when it is invalid. This is the dropdown:
<div class="col-md-3 col-sm-3 col-xs-6">
<div class="dd-arrow">
<h:selectOneMenu id="ccExpMonth" styleClass="form-control" value="#{paymentMethodsBean.ccExpMonth}" label="#{lang['paymentmethods.expmonth']}">
<f:selectItem itemLabel="" itemValue="#{null}" noSelectionOption="true" />
<f:selectItems value="#{dropDownListBean.ccExpMonths}" var="ccExpMonth" itemLabel="#{ccExpMonth.desc}" itemValue="#{ccExpMonth.code}" />
</h:selectOneMenu>
</div>
<p:message id="ccExpMonthMessage" for="ccExpMonth" styleClass="col-md-7 col-sm-6 col-xs-6" />
</div>
The backing bean:
@ManagedBean
@ViewScoped
@Data
@EqualsAndHashCode(callSuper = false)
public class PaymentMethodsBean extends BaseBean implements Serializable {
@Size(max = 2)
@NotBlank
private String ccExpMonth;
...
}