Skip to content

Beans and lists in template model

Pre-release
Pre-release
Compare
Choose a tag to compare
@Artur- Artur- released this 08 Jun 07:35

New features

  • Support for beans in template model
    public interface FormModel extends TemplateModel {
        public void setPerson(Person person);
        public Person getPerson();
    }
  • Getter for a bean returns a proxy object which is connected to the model (setters update the model values)
  • Setter for a bean copies the bean values into the model
  • Low level model API for handling beans in the model:
void TemplateModel.importBean(Object bean)
void TemplateModel.importBean(Object bean, Predicate<String> propertyNameFilter)
T TemplateModel.getProxy(String modelPath, Class<T> beanType)
  • Support for setting lists of beans in the model
public interface EmployeesModel extends TemplateModel {
    public void setEmployees(List<Employee> employees);
}
  • Support for setting attributes on template elements from Java
  • Support for binding to attributes in templates using [attr.placeholder]="modelPart"
  • Shorthand for setting boolean attributes: Element.setAttribute(String, boolean)
  • Shorthand for clearing an Input value: Input.clear()
  • All builds are automatically scalability tested using Gatling

Fixes

  • Use of the @Id annotation has been clarified in some tutorials

Demos

  • Initial version of an Address book demo Java HTML

Tutorials

All changes