Here is our primary View/MainView/ that contains the complete code of the View explained in bits and pieces:
/** * Base view shown when the application is started */ class MainView : View("Dictionary") { // Get the REST client private val api: Rest by inject() private val controller: WordController by inject() // UI elements private var inputWord: TextField by singleAssign() private var result: Label by singleAssign() init { // Configuring the client api.baseURI = "https://wordsapiv1.p.mashape.com/words/" api.engine.requestInterceptor = { (it as HttpURLRequest).addHeader("X-Mashape-Key", Constants.WORDS_API_KEY) } } /** * Root View */ override val root = vbox { addClass(cssRule) form { fieldset(labelPosition = Orientation. ...