Setup

Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
    formView.addRow("Agreement", "agree", "checkbox", ActionSwitch.create(this)
                    .addValidation(groupValidation, ValidationMode.ON_SUBMIT))
                .addRow("Lights", "light", "checkbox", ActionSwitch.create(this))
                .addRow("Password", "pwd", EditAction.create(this)
                    .addValidation(validation, ValidationMode.ON_CONTENT_CHANGE))
                .addRow("Password", "pwd2", EditAction.create(this).setRequired(true))
                .addRow("Random switch", "switch", ActionSwitch.create(this))
                .addRow("Time", "time", TimePickerAction.create(this))
                .addRow("Date", "date", DatePickerAction.create(this).setRequired(true))
                .addCustomRow("editArea", EditTextAreaAction.create(this).setHint("Large Text"))
                .addSubmitButton(submitButton)
                .addDataCallback(onDataCollected());

Result

Screenshot