ahn / vaadin-aceeditor

Vaadin wrapper for Ace editor
Apache License 2.0
24 stars 37 forks source link

setValue after setReadOnly(true) throws Exception #43

Closed rjahn closed 9 years ago

rjahn commented 9 years ago

If i try to set a value after setting readonly to true, an Exception will be thrown.

Shouldn't it be possible to set a value via API call in any case?

ahn commented 9 years ago

This is how the default Vaadin components (e.g. TextArea) work also. This component tries to follow the same API. (I agree with you that this seems like the wrong design, but I'm trying to mimic the Vaadin TextArea API.)

You have to work around it by first calling setReadOnly(false) http://stackoverflow.com/questions/25192327/programmatically-set-a-textfields-value-while-in-readonly-mode

rjahn commented 9 years ago

Understood. It would be a better API design (in my opinion) and less code is alwasy better for developers, but it's by design.