Change error indicator location for Form Field.

Is there a way to change the default position of the error indicator to be to the right of the component? I see that I could modify VFormLayout but that seems like overkill.

On a related subject, I needed to move the form level error indicator section to be at the top of the Form (from the default bottom position). The only way I found to do this was to replace VForm and move this line

DOM.appendChild(fieldSet, errorMessage.getElement());

Suggestions on a better solution here would be appreciated as well, as they are related problems.

Most Vaadin layouts do “fix” the structure so that you cannot do much to customize the location of the caption related elements and the error indicator. You might be able to move them around in some layouts with CSS, but that can get tricky and you can only do a few things that way.

You can use your own layout for a form, though. One option would be to use GridLayout and do the placement logic etc. in Form.attachField() using some extra labels for captions and error indicators - somewhat complicated but might be doable without any custom client side code.

As for the form level error message, you could probably clear it on the server side in a subclass of Form and put the message to some other layout outside the form. This, too, might be somewhat complicated, but probably should be doable without client side changes.