trait BaseAccess[F[_], S, M] extends AnyRef
- Alphabetic
- By Inheritance
- BaseAccess
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
downloadFileAsStream(handler: FileHandler[F]): F[LazyBytes[F]]
Get selected file as a stream from input
-
abstract
def
downloadFiles(id: ElementId[F]): F[List[(FileHandler[F], Array[Byte])]]
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.
-
abstract
def
downloadFilesAsStream(id: ElementId[F]): F[List[(FileHandler[F], LazyBytes[F])]]
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).
-
abstract
def
downloadFormData(id: ElementId[F]): 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
-
abstract
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 ()
-
abstract
def
focus(id: ElementId[F]): F[Unit]
Makes focus on the element
-
abstract
def
listFiles(id: ElementId[F]): F[List[FileHandler[F]]]
Get only file list for input
-
abstract
def
property(id: ElementId[F]): PropertyHandler[F]
Extracts property of element from client-side DOM.
Extracts property of element from client-side DOM.
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
Example: -
abstract
def
publish(message: M): F[Unit]
Publish message to environment.
-
abstract
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');
-
abstract
def
resetForm(id: ElementId[F]): F[Unit]
Purge inputs in given form.
Purge inputs in given form.
- id
form element id binding
-
abstract
def
sessionId: F[Qsid]
Gives current session id.
-
abstract
def
state: F[S]
Gives current state.
-
abstract
def
syncTransition(f: Transition[S]): F[Unit]
Applies transition to current state and awaits render.
-
abstract
def
transition(f: Transition[S]): F[Unit]
Applies transition to current state.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def evalJs(code: String): F[String]
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
maybeTransition(f: PartialFunction[S, S]): F[Unit]
Applies transition to current state.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
property(id: ElementId[F], propName: String): F[String]
Shortcut for
property(id).get(propName).Shortcut for
property(id).get(propName).- Since
0.13.0
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
valueOf(id: ElementId[F]): F[String]
Shortcut for
property(id).get('value).Shortcut for
property(id).get('value).- Since
0.6.0
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()