Packages

c

korolev.Context

MappedAccess

class MappedAccess[F[_], S1, SN, E] extends Access[F, SN, E]

Linear Supertypes
Access[F, SN, E], EventAccess[F, SN, E], BaseAccess[F, SN, E], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MappedAccess
  2. Access
  3. EventAccess
  4. BaseAccess
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new MappedAccess(self: Access[F, S1, E], read: PartialFunction[S1, SN], write: PartialFunction[(S1, SN), S1])(implicit arg0: Effect[F])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  6. def downloadFileAsStream(handler: FileHandler): F[Stream[F, Bytes]]

    Download file from the client side by file handler

    Download file from the client side by file handler

    Definition Classes
    MappedAccessBaseAccess
  7. def downloadFiles(id: ElementId): F[List[(FileHandler, Bytes)]]

    Download the selected file list from input appropriate to given element id.

    Download the selected file list from input appropriate to given element id. Use this method carefully because all files are saving to RAM.

    Definition Classes
    MappedAccessBaseAccess
  8. def downloadFilesAsStream(id: ElementId): F[List[(FileHandler, Stream[F, Bytes])]]

    Same as downloadFiles but for stream mode.

    Same as downloadFiles but for stream mode. The method is useful when user want to upload very large files list which is problematic to keep in memory (especially when count of users is more than one).

    Definition Classes
    MappedAccessBaseAccess
  9. def downloadFormData(id: ElementId): F[FormData]

    Downloads form from the client.

    Downloads form from the client. Useful when when you want to read big amount of fields. Do not use this method for downloading files, however it is possible.

    event(submit) { access =>
      access
        .downloadFormData(myForm)
        .flatMap { formData =>
          val picture = data.file("picture") // Array[Byte]
          val title = data.text("title") // String
          access.transition {
            // ... transtion
          }
        }
    }
    id

    form elementId

    Definition Classes
    MappedAccessBaseAccess
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. def evalJs(code: JsCode): F[String]

    Execute arbitrary JavaScript code on client and get stringified JSON back.

    Execute arbitrary JavaScript code on client and get stringified JSON back.

    for {
      _ <- access.evalJs("new Date().getTimezoneOffset()").map(offset => ...)
      _ <- access.evalJs(js"$myForm.submit()").map(offset => ...)
    } yield ()
    Definition Classes
    MappedAccessBaseAccess
  13. def evalJs(code: String): F[String]
    Definition Classes
    BaseAccess
  14. def eventData: F[String]

    Gives json with string, number and boolean fields of object of the event happened in current render phase.

    Gives json with string, number and boolean fields of object of the event happened in current render phase. Note that is expensive operation which requires network round trip.

    Definition Classes
    MappedAccessEventAccess
  15. def focus(id: ElementId): F[Unit]

    Makes focus on the element

    Makes focus on the element

    Definition Classes
    MappedAccessBaseAccess
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  18. def imap[S2](read: PartialFunction[SN, S2], write: PartialFunction[(SN, S2), SN]): Access[F, S2, E]
    Definition Classes
    MappedAccessBaseAccess
  19. def imap[S2](lens: Lens[SN, S2]): Access[F, S2, E]
    Definition Classes
    BaseAccess
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def listFiles(id: ElementId): F[List[FileHandler]]

    Get only file list for input

    Get only file list for input

    Definition Classes
    MappedAccessBaseAccess
  22. final def maybeTransition(f: PartialFunction[SN, SN]): F[Unit]

    Applies transition to current state.

    Applies transition to current state.

    Definition Classes
    BaseAccess
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  26. def property(id: ElementId): PropertyHandler[F]

    Extracts property of element from client-side DOM.

    Extracts property of element from client-side DOM.

    Definition Classes
    MappedAccessBaseAccess
    Example:
    1. event('click) { access =>
        for {
          request <- access.property(searchField).get('value)
          result  <- searchModel.search(request)
          _       <- access.transition {
            case state: State.Awesome =>
              state.copy(list = searchResult)
          }
        } yield ()
      }
    Since

    0.6.0

    See also

    Scope.elementId

  27. final def property(id: ElementId, propName: String): F[String]

    Shortcut for property(id).get(propName).

    Shortcut for property(id).get(propName).

    Definition Classes
    BaseAccess
    Since

    0.13.0

  28. def publish(message: E): F[Unit]

    Publish message to environment.

    Publish message to environment.

    Definition Classes
    MappedAccessBaseAccess
  29. def registerCallback(name: String)(f: (String) => F[Unit]): F[Unit]

    Register callback that could be invoked from the client side.

    Register callback that could be invoked from the client side.

    // Scala
    access.registerCallback("myCallback") { myArg =>
      Future(println(myArg))
    }
    
    // JavaScript
    Korolev.invokeCallback('myCallback', 'myArgValue');
    Definition Classes
    MappedAccessBaseAccess
  30. def resetForm(id: ElementId): F[Unit]

    Purge inputs in given form.

    Purge inputs in given form.

    id

    form element id binding

    Definition Classes
    MappedAccessBaseAccess
  31. def sessionId: F[Qsid]

    Gives current session id.

    Gives current session id.

    Definition Classes
    MappedAccessBaseAccess
  32. def state: F[SN]

    Gives current state.

    Gives current state.

    Definition Classes
    MappedAccessBaseAccess
  33. def syncTransition(f: Transition[SN]): F[Unit]

    Applies transition to current state and awaits render.

    Applies transition to current state and awaits render.

    Definition Classes
    MappedAccessBaseAccess
  34. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  35. def toString(): String
    Definition Classes
    AnyRef → Any
  36. def transition(f: Transition[SN]): F[Unit]

    Applies transition to current state.

    Applies transition to current state.

    Definition Classes
    MappedAccessBaseAccess
  37. def uploadFile(name: String, stream: Stream[F, Bytes], size: Option[Long], mimeType: String): F[Unit]

    Upload stream to the client side with selected name, size and mimeType

    Upload stream to the client side with selected name, size and mimeType

    Definition Classes
    MappedAccessBaseAccess
  38. final def valueOf(id: ElementId): F[String]

    Shortcut for property(id).get('value).

    Shortcut for property(id).get('value).

    Definition Classes
    BaseAccess
    Since

    0.6.0

  39. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  40. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  41. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated
  2. final def property(id: ElementId, propName: Symbol): F[String]

    Shortcut for property(id).get(propName).

    Shortcut for property(id).get(propName).

    Definition Classes
    BaseAccess
    Annotations
    @deprecated
    Deprecated

    (Since version 0.13.0) Use "propertyName" instead of 'propertyName

    Since

    0.6.0

Inherited from Access[F, SN, E]

Inherited from EventAccess[F, SN, E]

Inherited from BaseAccess[F, SN, E]

Inherited from AnyRef

Inherited from Any

Ungrouped