Class

com.hacklanta.formality

MultiSelectFieldHolder

Related Doc: package formality

Permalink

case class MultiSelectFieldHolder[FieldValueType, ValidationType >: FieldValueType, EventHandlerType >: FieldValueType](selector: String, initialValues: List[FieldValueType], options: List[net.liftweb.http.SHtml.SelectableOption[FieldValueType]], validations: List[Validation[List[ValidationType]]], boxedValidations: List[Validation[Box[List[ValidationType]]]], eventHandlers: List[EventHandler[List[EventHandlerType]]], asCheckboxes: Boolean) extends BaseFieldHolder[String, List[FieldValueType], List[ValidationType], List[EventHandlerType]] with Product with Serializable

This case class creates a field holder for a multi select field that gets a list of Strings from the client. If asCheckboxes is true, the binder created for this select field is designed to bind to checkboxes and their labels instead of producing a select field.

When dealing with select elements (i.e., asCheckboxes is false), the whole element specified by selector will be replaced by a new select element.

When asCheckboxes is true, the element specified by selector will be repeated once for each of the passed options. The option label will be used to set the text of the label. If the checkbox is nested in the label, it will be left at the end of the label. If a given SelectableOption specifies an id attribute, in addition to that attribute being set on the checkbox, the for attribute of the label element (if present) will be set to the same value.

Linear Supertypes
Serializable, Serializable, Product, Equals, BaseFieldHolder[String, List[FieldValueType], List[ValidationType], List[EventHandlerType]], FieldHolderBase[List[FieldValueType]], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MultiSelectFieldHolder
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. BaseFieldHolder
  7. FieldHolderBase
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MultiSelectFieldHolder(selector: String, initialValues: List[FieldValueType], options: List[net.liftweb.http.SHtml.SelectableOption[FieldValueType]], validations: List[Validation[List[ValidationType]]], boxedValidations: List[Validation[Box[List[ValidationType]]]], eventHandlers: List[EventHandler[List[EventHandlerType]]], asCheckboxes: Boolean)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def ->(eventHandler: EventHandler[List[EventHandlerType]]): BaseFieldHolder[String, List[FieldValueType], List[ValidationType], List[EventHandlerType]]

    Permalink

    Adds the given event handler to the list of event handlers this field will have on the client.

    Adds the given event handler to the list of event handlers this field will have on the client. See EventHandler for more. Meant to be used with Formality.on for fluency (e.g., field -> on("change", checkStuff _)).

    Note that FieldHolders are immutable; this returns a copy of this FieldHolder with an updated event handler list.

    Aliased as handlingEvent for folks who don't like operators.

    Definition Classes
    BaseFieldHolder
  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  5. def ?(boxedValidation: Validation[Box[List[ValidationType]]])(implicit dummy: DummyImplicit): BaseFieldHolder[String, List[FieldValueType], List[ValidationType], List[EventHandlerType]]

    Permalink

    Adds the given boxed validation to the list of validations run on this field at form processing time.

    Adds the given boxed validation to the list of validations run on this field at form processing time. Note that validations may add attributes to the field to indicate on the client side what types of validations are expected; see the Validation trait for more.

    Note that FieldHolders are immutable; this returns a copy of this FieldHolder with an updated validation list.

    Aliased as validatingWith for folks who don't like operators.

    Definition Classes
    BaseFieldHolder
  6. def ?(validation: Validation[List[ValidationType]]): BaseFieldHolder[String, List[FieldValueType], List[ValidationType], List[EventHandlerType]]

    Permalink

    Adds the given validation to the list of validations run on this field at form processing time.

    Adds the given validation to the list of validations run on this field at form processing time. Note that validations may add attributes to the field to indicate on the client side what types of validations are expected; see the Validation trait for more.

    Note that FieldHolders are immutable; this returns a copy of this FieldHolder with an updated validation list.

    Aliased as validatingWith for folks who don't like operators.

    Definition Classes
    BaseFieldHolder
  7. def addValidationErrors(errorMessages: String*): Unit

    Permalink

    Adds the passed error messages, using S.error.

    Adds the passed error messages, using S.error. Can be overridden to use something other than S.error.

    Attributes
    protected
    Definition Classes
    BaseFieldHolder
  8. val asCheckboxes: Boolean

    Permalink
  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def baseTransform: CssSel

    Permalink

    Defines the base transform that adds the function id and initial value to the HTML field specified in the selector parameter.

    Defines the base transform that adds the function id and initial value to the HTML field specified in the selector parameter. When overriding, it is highly suggested that you call super.baseTransform and append your own transforms to that.

    Attributes
    protected
    Definition Classes
    BaseFieldHolder
  11. val binder: CssSel

    Permalink

    Provides the CSS transform that transforms an input field in the template into one that will be processed by this field's value conversion and validation functions, that will have the provided initial value, and that will run this field's associated callbacks for the event handlers it has specified.

    Provides the CSS transform that transforms an input field in the template into one that will be processed by this field's value conversion and validation functions, that will have the provided initial value, and that will run this field's associated callbacks for the event handlers it has specified.

    If you override the binder, please make sure you properly map your handler function, event handlers, and validations. This binder automatically calls generateFunctionIdAndHandler and binds its result to the name of the HTML field, and your code must do something similar to ensure the server-side function you define is called on form submission.

    Definition Classes
    MultiSelectFieldHolderBaseFieldHolderFieldHolderBase
  12. val boxedValidations: List[Validation[Box[List[ValidationType]]]]

    Permalink
  13. def checkboxBinder: CssSel

    Permalink
  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. def computeFieldValue: Box[List[FieldValueType]]

    Permalink

    Computes the final field value and applies any validations.

    Computes the final field value and applies any validations. Ensures validations only run once no matter how many times the field value is accessed.

    Attributes
    protected
    Definition Classes
    BaseFieldHolder
  16. val computedFieldValue: FieldValueVar[List[FieldValueType]]

    Permalink

    This is the final computed field value after all validations have been handled.

    This is the final computed field value after all validations have been handled. It memoizes the result of computeFieldValue.

    Attributes
    protected
    Definition Classes
    BaseFieldHolder
  17. def convertValue(incomingValue: String): Empty.type

    Permalink
    Attributes
    protected
    Definition Classes
    MultiSelectFieldHolderBaseFieldHolder
  18. val defaultNonces: List[String]

    Permalink
  19. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. val eventHandlers: List[EventHandler[List[EventHandlerType]]]

    Permalink
  21. val fieldName: FieldNameVar

    Permalink

    Stores the field name generated by generateFunctionIdAndHandler.

    Stores the field name generated by generateFunctionIdAndHandler. The current field name should be accessed from here rather than directly through generateFunctionIdAndHandler except in case of clear preference.

    Attributes
    protected
    Definition Classes
    BaseFieldHolder
  22. val fieldValue: FieldValueVar[List[FieldValueType]]

    Permalink

    The handler function should set this TransientRequestVar to the appropriate value.

    The handler function should set this TransientRequestVar to the appropriate value.

    Attributes
    protected
    Definition Classes
    BaseFieldHolder
  23. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def generateFunctionIdAndHandler: String

    Permalink

    Creates a handler function, maps it (potentially using S.fmapFunc), and returns the resulting function id to bind to the HTML field.

    Creates a handler function, maps it (potentially using S.fmapFunc), and returns the resulting function id to bind to the HTML field. See the implementation in SimpleFieldHolder for a sample.

    Attributes
    protected
    Definition Classes
    MultiSelectFieldHolderBaseFieldHolder
  25. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  26. def handlingEvent(eventHandler: EventHandler[List[EventHandlerType]]): MultiSelectFieldHolder[FieldValueType, ValidationType, EventHandlerType]

    Permalink

    This should return a copy of this BaseFieldHolder with the specified event handler attached.

    This should return a copy of this BaseFieldHolder with the specified event handler attached. Left abstract because by far the best implementation is using a case class copy method.

    Definition Classes
    MultiSelectFieldHolderBaseFieldHolder
  27. val initialValues: List[FieldValueType]

    Permalink
  28. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  29. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  30. val noncedOptions: List[net.liftweb.http.SHtml.SelectableOption[String]]

    Permalink
  31. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  32. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  33. val optionProcessor: (List[String]) ⇒ List[FieldValueType]

    Permalink
  34. val options: List[net.liftweb.http.SHtml.SelectableOption[FieldValueType]]

    Permalink
  35. def selectBinder: CssSel

    Permalink
  36. val selector: String

    Permalink
  37. def serializeValue(value: List[FieldValueType]): String

    Permalink
    Attributes
    protected
    Definition Classes
    MultiSelectFieldHolderBaseFieldHolder
  38. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  39. def validatingWith(boxedValidation: Validation[Box[List[ValidationType]]])(implicit dummy: DummyImplicit): MultiSelectFieldHolder[FieldValueType, ValidationType, EventHandlerType]

    Permalink

    This should return a copy of this BaseFieldHolder with the specified validation attached.

    This should return a copy of this BaseFieldHolder with the specified validation attached. Left abstract because by far the best implementation is using a case class copy method.

    Definition Classes
    MultiSelectFieldHolderBaseFieldHolder
  40. def validatingWith(validation: Validation[List[ValidationType]]): MultiSelectFieldHolder[FieldValueType, ValidationType, EventHandlerType]

    Permalink

    This should return a copy of this BaseFieldHolder with the specified validation attached.

    This should return a copy of this BaseFieldHolder with the specified validation attached. Left abstract because by far the best implementation is using a case class copy method.

    Definition Classes
    MultiSelectFieldHolderBaseFieldHolder
  41. val validations: List[Validation[List[ValidationType]]]

    Permalink
  42. def value: Box[List[FieldValueType]]

    Permalink

    Returns the current value of the field.

    Returns the current value of the field. If no value was seen in the last form submission, invokes boxedValidations and registers any resulting validation errors.

    Definition Classes
    BaseFieldHolderFieldHolderBase
  43. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from BaseFieldHolder[String, List[FieldValueType], List[ValidationType], List[EventHandlerType]]

Inherited from FieldHolderBase[List[FieldValueType]]

Inherited from AnyRef

Inherited from Any

Ungrouped