nbhanji
11/23/2019, 2:31 PMnbhanji
11/23/2019, 10:26 PMclass FileConnectView : Fragment("Connect to Site") {
private val itemsController: FileMenuItemsController by inject()
private val model = ViewModel()
private val username = model.bind{ SimpleStringProperty() }
private val password = model.bind {SimpleStringProperty() }
private val site = model.bind { SimpleStringProperty() }
override val root = form {
addClass(Styles.loginForm)
fieldset {
field("Username")
textfield(username){
required()
}
field("Password")
textfield(password) {
required()
}
field("Site")
textfield(site)
button("Connect to Site") {
paddingTop = 30
enableWhen(model.valid)
isDefaultButton = true
useMaxWidth = true
action {itemsController.connect(username.value, password.value, site.value ) }
}
}
label(itemsController.statusProperty) {
style {
paddingTop = 10
textFill = Color.RED
}
}
}
init {
reloadStylesheetsOnFocus()
}