Hey!
i want to have a field (artikelnummer Typ) in a entity editor only editable on creation. If it’s created, the value cannot be changed.
Is is possible?
Best regards.
Rexontext
Hey!
i want to have a field (artikelnummer Typ) in a entity editor only editable on creation. If it’s created, the value cannot be changed.
Is is possible?
Best regards.
Rexontext
Hi Laurens!
You could (ab)use the InitEntityEvent for this purpose. Forget about the event data itself, the important thing here is, that this event is only triggerd if an editor screen is opened for a new entity.
editable="false"
to your field tag)true
In Kotlin, your screen controller might contain code like this:
@Inject
private lateinit var artikelnummerTypField: LookupField<Artikeltypen>
@Subscribe
private fun onInitEntity(event: InitEntityEvent<Apotheke>) {
artikelnummerTypField.isEditable = true
}
This way, your field is normally not editable, unless your editor is opened for a new instance.
Greetings,
Manuel