The TextField, TextArea and PasswordField components (all children of AbstractTextField) accept a "class" attribute as an informal parameter. This is rendered correctly when the component is rendered normally.
However when the field has a validation error the ValidationDecorator will set class="t-error" before the informal attributes are added. This prevents any user supplied classes being rendered.
ValidationDecorator works correctly if the class attribute has already been written (it adds t-error it that case), the issue is that the AbstractTextField calls the decorator before the informal attributes are rendered.
I'm not sure of the best way to ensure the decorator is called after the informal parameters. The options I see are
a) remove the RenderInformals mixin from AbstractField & call renderInformalParameters explicitly
-> downside is other children of AbstractField also have to explicitly deal with informal parameters
b) make class an explicit parameter
-> downside is that it has to be added to attributes explicitly somewhere
c) move the validation render & decorate to the BeforeRenderTemplate phase
-> which feels a bit like a hack
I think option (a) is probably best.....
(happy to supply patch for whichever approach)
|Field||Original Value||New Value|
|Affects Version/s||5.0.4 [ 12312381 ]|
|Fix Version/s||5.0.4 [ 12312381 ]|
|Fix Version/s||5.0.6 [ 12312544 ]|
|Assignee||Howard M. Lewis Ship [ hlship ]|
|Resolution||Fixed [ 1 ]|
|Status||Open [ 1 ]||Closed [ 6 ]|
|Workflow||jira [ 12402054 ]||Default workflow, editable Closed status [ 12569178 ]|
|Workflow||Default workflow, editable Closed status [ 12569178 ]||jira [ 12590437 ]|