lugreen
(Ray Lv)
#1
Hi,
In 6.x , the document include a part for assigning initial values.
But seems it is outdated.
Fox example,In CUBA 7 ,the screen use StandardEditor, there is no initNewItem method.
Finally ,i figure out the problem using the setEntityToEdit method.
For assigning initial value ,is there a document in V7 ?
lugreen
(Ray Lv)
#2
1 Like
artamonov
(Yuriy Artamonov)
#3
Use InitEntityEvent
in StandardEditor and MasterDetailScreen:
@Subscribe
protected void onInitEntity(InitEntityEvent<Foo> event) {
event.getEntity().setStatus(Status.ACTIVE);
}
1 Like
krivopustov
(Konstantin Krivopustov)
#5
The examples of initializing data in screens will be moved from the documentation to the Guides shortly.