protected String text = "";
protected MWebTextBox.TextAlignment textAlignment = null;
+ protected Integer maximumLength = null;
protected boolean enabledMode = true;
return this.getTextAlignment().toString();
}
+ /* Maximum length */
+
+ public void setMaximumLength(Integer maximumLength) {
+ this.setMaximumLength(maximumLength, true);
+ }
+
+ protected void setMaximumLength(Integer maximumLength, boolean refreshMode) {
+ if ((null != maximumLength) && (0 > maximumLength)) {
+ throw new IllegalArgumentException("Invalid 'maximumLength': negative number.");
+ }
+ //
+ this.maximumLength = maximumLength;
+ //
+ if (refreshMode) {
+ try {
+ this.refreshMaximumLength();
+ }
+ catch (MNoBrowserPageWebException exception) {
+ }
+ catch (MNoViewWebException exception) {
+ }
+ catch (MNoWidgetIdWebException exception) {
+ }
+ catch (MResponseWebException exception) {
+ }
+ }
+ }
+
+ public Integer getMaximumLength() {
+ return this.maximumLength;
+ }
+
+ public String getFormattedMaximumLength() throws MNullPropertyWebException {
+ if (null == this.getMaximumLength()) {
+ throw new MNullPropertyWebException("Invalid maximum length: property null.");
+ }
+ return this.getMaximumLength().toString();
+ }
+
/* Enabled mode */
public void setEnabledMode(boolean enabledMode) {
}
}
+ protected void refreshMaximumLength() throws MNoBrowserPageWebException, MNoViewWebException, MNoWidgetIdWebException, MResponseWebException {
+ this.checkPresence();
+ //
+ try {
+ this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').maxLength = '%s'; }", this.getId(), this.getId(), this.getFormattedMaximumLength()));
+ }
+ catch (MNullPropertyWebException exception) {
+ this.getApplicationContextReference().addPlainTextResponseContent(String.format("if ($('%s')) { $('%s').maxLength = null; }", this.getId(), this.getId()));
+ }
+ }
+
protected void refreshEnabledMode() throws MNoBrowserPageWebException, MNoViewWebException, MNoWidgetIdWebException, MResponseWebException {
this.checkPresence();
//