THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||
---|---|---|---|---|
| ||||
public class CrudPage extends Page { // Adds the control to the page @Bindable("control"BindingType.CONTROL) private Form form = new Form(); // Adds the control to the page @Bindable("control"BindingType.CONTROL) private Table table = new Table(); // Adds the value to the page model before the page template is rendered @Bindable("model"BindingType.MODEL) private String pageTitle; // Binds the request value "customerId" to this method performing type conversion @Bindable("request"BindingType.REQUEST) public void setCustomerId(Integer id) { CustomerDao customerDao = DaoFactory.getCustomerDao(); Customer customer = customerDao.getCustomerForPK(id); form.copyFrom(customer); } } |
Thanks Fredrik Jonson for the BindingType enum suggestion.