Access
Provides access to make side effects
Value members
Inherited methods
Download file from the client side by file handler
Download file from the client side by file handler
- Inherited from:
- BaseAccess
Download the selected file list from input appropriate to given element id. Use this method carefully because all files are saving to RAM.
Download the selected file list from input appropriate to given element id. Use this method carefully because all files are saving to RAM.
- Inherited from:
- BaseAccess
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).
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).
- Inherited from:
- BaseAccess
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.
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
}
}
}
- Value parameters:
- id
form elementId
- Inherited from:
- BaseAccess
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 ()
- Inherited from:
- BaseAccess
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.
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.
- Inherited from:
- EventAccess
Shortcut for property(id).get(propName)
.
Shortcut for property(id).get(propName)
.
- Since:
0.13.0
- Inherited from:
- BaseAccess
Extracts property of element from client-side DOM.
Extracts property of element from client-side DOM.
- See also:
- Since:
0.6.0
- Example:
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 () }
- Inherited from:
- BaseAccess
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');
- Inherited from:
- BaseAccess
Purge inputs in given form.
Purge inputs in given form.
- Value parameters:
- id
form element id binding
- Inherited from:
- BaseAccess
Applies asynchronous transition to current state. All transitions will wait until this transition will executed.
Applies asynchronous transition to current state. All transitions will wait until this transition will executed.
NOTE: Do not use this method id you work with effects which take lot of time for execution. It's may lead to hanging of your app.
- Inherited from:
- BaseAccess
Applies transition to current state and awaits render.
Applies transition to current state and awaits render.
- Inherited from:
- BaseAccess
Upload stream to the client side with selected name, size and mimeType
Upload stream to the client side with selected name, size and mimeType
- Inherited from:
- BaseAccess
Shortcut for property(id).get('value)
.
Shortcut for property(id).get('value)
.
- Since:
0.6.0
- Inherited from:
- BaseAccess
Deprecated and Inherited methods
Shortcut for property(id).get(propName)
.
Shortcut for property(id).get(propName)
.
- Since:
0.6.0
- Deprecated
- Inherited from:
- BaseAccess
- Deprecated
[Since version 1.5.0]
- Inherited from:
- BaseAccess