Smoother UI
The repainting() element is used to indicate that the value held by the property never changes over time, even when other properties of the object do change.
Setting this attribute to true is used as a hint to the viewer to not redraw the property after an AJAX update of some other property/ies of the object have changed.
This is primarily for performance, eg can improve the user experience when rendering PDFs/blobs.
Note that for this to work, the viewer will also ensure that none of the property’s parent component (such as a tab group panel) are re-rendered.
|
Design note: we considered implementing this an "immutable" flag on the @Property annotation (because this flag is typically appropriate for immutable/unchanging properties of a domain object). However, we decided not to do that, on the basis that it might be interpreted as having a deeper impact within the framework than simply a hint for rendering. |
For example:
import lombok.Getter;
import lombok.Setter;
public class Document {
@PropertyLayout(
repainting=Repainting.NO_REPAINT
)
@Getter @Setter
private Blob blob;
// ...
}