Input
input(<expression>) creates an input form element. Can be applied directly to the properties of an entity (e.g., input(user.name)) or to page variables.
Input widgets are determined by the type of the property passed to the input template call:
- String, Email, Int, Float, URL, Patch -> textfield
- Text, WikiText -> textarea
- Bool -> checkbox
- Date, DateTime, Time -> date picker
- List<Entity>, Set<Entity> -> multiselect (bug: List actually requires a different type of input, to allow duplicates and control ordering)
- Entity -> select
For example, to get a checkbox, use:
define root(){
var x : Bool := false
form{
input(x)
submit action{ log(x); } { "log result" }
}
}
or:
entity TestEntity {
x :: Bool
}
define editTestEntity (e:TestEntity){
form{
input(e.x)
submit action{ } { "update entity" }
}
}
