Unlike other form item types, the AutoFitTextAreaItem doesn't inherit the message from the containing form for the setCanEdit() method.
That is, if I configure the text area with "setCanEdit(false)", calling form.setCanEdit(true) does not make the text area editable. Similarly, form.setCanEdit(false) does not disable editing of the text area.
I'm trying to make the form edit/save/cancel functionality somewhat generic. This problem lets unexpected concerns leak into the code.
Form item initialization:
Event handler for "Edit" toolstrip button:
1. Isomorphic SmartClient/SmartGWT Framework (SNAPSHOT_v8.3d_2012-10-09/Enterprise Deployment 2012-10-09)
2. browser(s) and version(s) involved: IE 9
3. N/A
4. N/A
5. N/A
6. Please let me know if the code above needs more detail.
That is, if I configure the text area with "setCanEdit(false)", calling form.setCanEdit(true) does not make the text area editable. Similarly, form.setCanEdit(false) does not disable editing of the text area.
I'm trying to make the form edit/save/cancel functionality somewhat generic. This problem lets unexpected concerns leak into the code.
Form item initialization:
Code:
final AutoFitTextAreaItem textInput = new AutoFitTextAreaItem("text"); textInput.setShowTitle(false); textInput.setWidth("*"); textInput.setColSpan(4); textInput.setCanEdit(false);
Code:
public void startEditing() { this.form.setCanEdit(true); // handle TextAreaItem members // currently done by item name final FormItem textItem = form.getItem("text"); if (textItem != null) { textItem.setCanEdit(true); } this.saveButton.show(); this.cancelButton.show(); this.resetButton.show(); if (this.extraEditButtons != null) { for (final ToolStripButton button : extraEditButtons) { button.show(); } } this.modifyButton.hide(); }
2. browser(s) and version(s) involved: IE 9
3. N/A
4. N/A
5. N/A
6. Please let me know if the code above needs more detail.
Comment