I was wondering if there was a way to change to style of a hint when the form item it's attached to is disabled. Thanks!
Announcement
Collapse
No announcement yet.
X
-
That works to change the style but I wanted to have two separate styles for when the form item is enabled and disabled. For example, when the form item is enabled, the hint is blue. When the form is disabled, the hint is green.
I tried calling setHintStyle("myStyle") and adding a myStyleDisabled style in my css file but that didn't work.
Comment
-
Thanks for the hint. We were disabling the items using DynamicForm.setDisabled() so we overrode it to loop through the items and disable the form items manually:
Code:@Override public void setDisabled(boolean disabled) { super.setDisabled(disabled); for (FormItem item : getFields()) { item.setDisabled(disabled); } }
Code:@Override public void setDisabled(Boolean disabled) { super.setDisabled(disabled); if (disabled) { // Do not call this.setHintStyle super.setHintStyle(hintStyle + "Disabled"); } else { super.setHintStyle(hintStyle); } } @Override public void setHintStyle(String hintStyle) { // Call super super.setHintStyle(hintStyle); // Save locally this.hintStyle = hintStyle; }
Comment
Comment