Generating controls for properties
Across platform provides base building blocks to build controls with the`ViewElement` class. More information can be found in the ViewElement infrastructure section.
When the bootstrap-ui-module
is loaded the basic ViewElement
representations are enriched with bootstrap 3.
EntityViewElementBatch -Generating controls for an entity
An EntityViewElementBatch
is a helper class that helps you with generating controls for an entity.
It requires an entity, an EntityPropertySelector
and a ViewElementMode
.
The EntityViewElementBatch.build()
methods generates a collection of ViewElement
for all properties specified in the EntityPropertySelector
.
EntityViewElementBatch<MyEntity> batch = entityViewElementBuilderHelper.createBatchForEntity(userEntity);
batch.setPropertySelector(EntityPropertySelector.of("gender","name", "email"));
batch.setViewElementMode(ViewElementMode.FORM_WRITE);
Map<String, ViewElement> elements = batch.build();
The EntityViewElementBuilderHelper can be used to easily create an EntityViewElementBatch .
|
BuilderHints
An EntityViewElementBatch
can be enriched with a map of builderHints to control the viewElement output.
The map keys are the property names, the value should be one of the following:
Type | Description |
---|---|
|
The specific |
|
When providing a |
|
Provide your own custom |
|
Provide a fixed element that should be returned |
-
TODO
-
How does viewElementBatch work (Small explanation)
-
EntityPropertyRegistry
-
BuilderContext