CompositeKeySetter

com.raquo.laminar.modifiers.CompositeKeySetter
class CompositeKeySetter[K <: Key, -El <: Base](val key: CompositeKey[K, El], val itemsToAdd: List[String]) extends Setter[El]

This is like KeySetter, but for composite attributes like cls and role.

CompositeKeySetter can not be a subtype of KeySetter because we can not implement val value – the actual value to be set is dynamic, depending on the current value of the element's composite attribute.

Also, if you call cls := "class2" after calling cls := "class1", you end up with two classes instead of just "class2", which is different fro KeySetter semantics.

Note: for dynamic subscriptions (<--), we use KeyUpdater for all keys including composite attributes.

Value parameters

itemsToAdd

Note: must be normalized (no empty strings; one value per item)

Attributes

Graph
Supertypes
trait Setter[El]
trait Modifier[El]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def :=(include: Boolean): CompositeKeySetter[K, El]

If include is true, the items will be added, if false, they will not be added

If include is true, the items will be added, if false, they will not be added

Attributes

def <--(include: Source[Boolean]): KeyUpdater[El, CompositeKey[K, El], List[String]]

If the include observable emits true, value(s) will be added, if it emits false, they will be removed (but only if they were previously added - see docs).

If the include observable emits true, value(s) will be added, if it emits false, they will be removed (but only if they were previously added - see docs).

Attributes

override def apply(element: El): Unit

This is called by Laminar when composite key setter is used as a modifier, i.e. when you say div(cls := "foo") – much like the usual KeySetter-s.

This is called by Laminar when composite key setter is used as a modifier, i.e. when you say div(cls := "foo") – much like the usual KeySetter-s.

Attributes

Definition Classes
def apply(include: Boolean): CompositeKeySetter[K, El]

If include is true, the items will be added, if false, they will not be added

If include is true, the items will be added, if false, they will not be added

Attributes

Concrete fields

val itemsToAdd: List[String]
val key: CompositeKey[K, El]