code: @Deprecated
  	public void setMandatory(final boolean mandatory, final String errorMessage) {
  		WComponent labelField = findComponentForLabel(field);
  
  		if (labelField instanceof Mandatable) {
  			((Input) labelField).setMandatory(mandatory, errorMessage);
  		} else if (labelField instanceof WFieldSet) {
  			((WFieldSet) labelField).setMandatory(mandatory, errorMessage);
  		}
  	}
docs: Sets whether this field is mandatory.
  <p>
  The mandatory flag will only be set if the field is a {@link Input} component or {@link WFieldSet}.
  </p>
  
  @param mandatory true for mandatory, false for optional
  @param errorMessage the error message to display on validation error.
  @deprecated set mandatory directly on the required component.