I have a field that I would like to be read-only and have a default value.
here what I have till now:
object passwd extends MappedString(this, 20)
{
override def defaultValue = "XXX" + Random.alphanumeric.take(12).mkString // some default value
// readOnly = true // Or something similar???
}
I tried overriding toHtml, asHtml, toForm, displayHtml but they all change the view or the label or something else.
I just want the defaultValue to be automatically generated (which works) but the users not to be able to edit that field when create/editing the entity.
Any advice would be very much appreciated
Got it,
Just override _toForm and disable the input element: