Fluent builder for rendering an ExtraField as an HTML form control, with the value, CSS classes, name attributes and kcode selection flag configured through chained setter methods before calling html(). An instance is created by ExtraField.render() and is scoped to a single rendering call - it is not reused.
Group: Custom Fields
Methods
value(Object v)
Returns: ExtraFieldRenderer
Sets the value to render into the form control.
| Parameter | Description |
|---|---|
v | the value to render |
extraClasses(String v)
Returns: ExtraFieldRenderer
Sets additional CSS classes to add to the rendered form control.
| Parameter | Description |
|---|---|
v | the additional CSS classes |
namePrefix(String v)
Returns: ExtraFieldRenderer
Sets a prefix to prepend to the rendered form control's name attribute.
| Parameter | Description |
|---|---|
v | the name prefix |
nameOverride(String v)
Returns: ExtraFieldRenderer
Overrides the name attribute the form control would otherwise be rendered with.
| Parameter | Description |
|---|---|
v | the name to use instead of the field's own name |
kcodeSelection(Boolean kcodeSelection)
Returns: ExtraFieldRenderer
Sets whether the rendered form control should present kcode-based selection.
| Parameter | Description |
|---|---|
kcodeSelection | true to render kcode selection |
html()
Returns: String
Renders the field to HTML using the values configured on this renderer, with no owning entity.
html(Relational owner)
Returns: String
Renders the field to HTML using the values configured on this renderer. Tries the admin/extraField.html Velocity template first, and if that fails falls back to building the markup directly in Java: a select if options are configured, a file upload widget if the field is a file upload, or a text input or textarea otherwise depending on the rows setting.
| Parameter | Description |
|---|---|
owner | the entity that owns the field's value, made available to the Velocity template, may be null |