A data binding framework for web based user interfaces with Vaadin
Clone or download
Jenkins FaktorZehn.org
Latest commit 4b38fec Dec 10, 2018

README.adoc

linkki

License Maven Central

linkki is a data binding framework that makes building UI in vaadin applications easier and faster.

Features

Applications often consist of a variety of input elements that closely mirror objects and properties of a domain model. Creating such user interfaces and implementing the synchronization with the domain model is often a repetitive task. linkki automates most of the data binding tasks, enabling developers to focus on the domain and UI logic.

  • Fast UI development

  • Declarative UI definition (with annotations)

  • UI logic implementation using the presentation model pattern (PMO)

  • Automatic data binding between (P)MO and UI elements

  • Dynamic binding of other UI properties, including

    • Visibility

    • Enabled-state

    • List of available values

Examples

Model Binding
    @ModelObject
    public Report getReport() {
        return report;
    }
Textfield/Textarea
    @UITextArea(position = 10, label = "Description", modelAttribute = "description", required = RequiredType.REQUIRED, rows = 5, columns = 50)
    public void description() {
        /* Use description from report (model object) directly */
    }
ComboBox
    @UIComboBox(position = 20, label = "Type", modelAttribute = "type", required = RequiredType.REQUIRED)
    public void type() {
        /*
         * - bind value to the property "type" from report - use enum constants from ReportType as
         * available values
         */
    }
Button
    @UIButton(position = 30, caption = "Send", icon = FontAwesome.SEND, showIcon = true, enabled = EnabledType.DYNAMIC)
    public void send() {
        report.save();
        Notification.show(
                          String.format("Report with id %d filed!", report.getId()),
                          "Thank you for reporting!",
                          Notification.Type.TRAY_NOTIFICATION);
    }

    /**
     * Enable button only if description and type is present.
     *
     * @return {@code true} if button is enabled otherwise {@code false}
     */
    public boolean isSendEnabled() {
        String description = report.getDescription();
        return description != null && !description.isEmpty()
                && report.getType() != null;
    }
}
report disabled
Figure 1. Report with disabled send button
report enabled
Figure 2. Report with enabled send button
Note
The complete example can be found at Getting Started - 'Error report' tutorial.

Installation

linkki is available from Maven Central and can be included via Maven/Gradle:

Maven dependency
<dependency>
  <groupId>org.linkki-framework</groupId>
  <artifactId>linkki-core</artifactId>
  <version>${linkki.version}</version>
</dependency>

Contribution

  • Bug reports, new ideas and improvements can be created in the GitHub issue tracker

  • Collaboration on issues/tasks via pull requests

Documentation

Documentation for linkki can be found at doc.linkki-framework.org.

License

Copyright Faktor Zehn GmbH.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.