MaddonForm setEditable(false)

I’m using a form via the addon MaddonForm, and I can set the contents of the fields, but I’d like to make them view-only. Is that possible?


If I remember correctly, there is a “feature” in the Vaadin FieldGroup, which is used behind the scenes, that overrides the value from field, based on the propertys value. Thus it probably has no effect if you set fields read-only value to false in your view?

IMO it is a design flaw, and I think there is even a bug about it in Still, I think we could make a workaround to the MaddonForm pretty easily. Dare to fill an enhancement issue to
the github project page
, so we don’t forget about this? I think I could look at this later this week.


Just to be clear I am using the EntityExpander for a VaadinForm (saw it in your webcast with Geertjan), and setting the entity from a facade class (and EJB for an entity class from a database table). Calling the setReadOnly(true) method has no effect on the fields, they remain editable.
Also, is it possible to then hide the save/cancel buttons since they are pointless for a read-only presentation of the data?
If we’re on the same page, I will file an issue on the github page.

Ah, so you want to make the whole “form” read-only, not just one field? Propagating that is a different thing, but feel free to add issue about that as well. I don’t actually even know why that is defined in AbstractComponent, would make sensty to be just stuff related to Fields.

You can hide the save/cancel buttons just by leaving out the “getToolbar()” in createContent method.