});
}
- // For backward compatibility; to be moved to TextArea
- if (uidl.hasAttribute("wordwrap")) {
- setWordwrap(uidl.getBooleanAttribute("wordwrap"));
+ // Here for backward compatibility; to be moved to TextArea.
+ // Optimization: server does not send attribute for the default 'true'
+ // state.
+ if (uidl.hasAttribute("wordwrap")
+ && uidl.getBooleanAttribute("wordwrap") == false) {
+ setWordwrap(false);
+ } else {
+ setWordwrap(true);
}
}
valueChange(false);
}
- // For backward compatibility; to be moved to TextArea
+ // Here for backward compatibility; to be moved to TextArea
public void setWordwrap(boolean enabled) {
if (enabled == wordwrap)
return; // No change
target.addAttribute("rows", String.valueOf(rows));
target.addAttribute("multiline", true);
- // For backward compatibility; to be moved to TextArea
- target.addAttribute("wordwrap", isWordwrap());
+ // Optimization: the default true is assumed if not painted
+ if (!isWordwrap()) {
+ target.addAttribute("wordwrap", false);
+ }
}
if (getInputPrompt() != null) {