classafFormBean::SkinCtx

sys::Obj
  afFormBean::SkinCtx

Passed to InputSkins to provide all the information they need to render a form field.

bean

Source

Obj? bean { internal set }

The bean instance being rendered.

beanInvalid

Source

Bool beanInvalid()

Returns true if the bean is invalid; that is, if any field is in error.

errMsg

Source

Str? errMsg()

Returns the error message associated with this field.

field

Source

const Field field

The corresponding bean field.

fieldInvalid

Source

Bool fieldInvalid()

Returns true if the field is invalid. Note that if invalid, the field may not have an error msg.

fieldValue

Source

Obj? fieldValue()

Returns the field value.

formBean

Source

FormBean formBean { internal set }

The containing FormBean instance.

formField

Source

FormField formField { internal set }

The FormField being rendered.

label

Source

Str label()

Returns the preferred display label associated with the field.

name

Source

Str name()

Returns the name of the field. Safe for use as an ID / CSS class name.

renderAttributes

Source

Str renderAttributes([Str:Str]? extraAttributes := null)

Returns a rendered string of common attributes to be placed in the <input> HTML tag. This includes id, name and any validation attributes defined on the HtmlInput facet.

Note the string does not contain the type or value attributes as these are dependent on the input type.

The given extraAttributes are merged in, allowing you to pass in extra css styles:

attrs := skinCtx.renderAttributes(["autocomplete" : "off"])

Note that empty string values are rendered as HTML5 empty attributes.

toClient

Source

Str toClient(Obj? value)

Converts the given value to a string using the preferred ValueEncoder.

value

Source

Str value()

Returns the preferred string value to be rendered in the <input>.