Uploaded image for project: 'Errai'
  1. Errai
  2. ERRAI-405

Add The Ability to bind to Lists

    Details

      Description

      I believe this is something that will be required in order for the databinding framework to be useful for anything more than simple cases. Many business objects will have lists of objects (think of an invoice with lines).

      I would assume that this might involve both databinding and errai-ui. This is a feature that is currently supported (although I'm not wild about its implementation) by the GWT Editor module

        Gliffy Diagrams

          Activity

          Hide
          csa Christian Sadilek added a comment -

          In Errai 2.2, data binding to lists can be achieved using the org.jboss.errai.ui.client.widget.ListWidget class. It can be sub classed if richer functionality is required or simply injected as is, e.g.:

          @Inject ListWidget<GroceryItem, GroceryItemWidget> groceryListWidget;

          Calling listWidget.setItems(groceryItems) will cause a GroceryItemWidget to be displayed for each item in the list. The item widget instances are managed by the client-side bean manager and can therefore leverage declarative data binding. Every item in the list will be bound to the corresponding widget instance.

          Example that uses this functionality:
          https://github.com/errai/errai/blob/master/errai-jpa/demos/errai-jpa-demo-grocery-list/

          Show
          csa Christian Sadilek added a comment - In Errai 2.2, data binding to lists can be achieved using the org.jboss.errai.ui.client.widget.ListWidget class. It can be sub classed if richer functionality is required or simply injected as is, e.g.: @Inject ListWidget<GroceryItem, GroceryItemWidget> groceryListWidget; Calling listWidget.setItems(groceryItems) will cause a GroceryItemWidget to be displayed for each item in the list. The item widget instances are managed by the client-side bean manager and can therefore leverage declarative data binding. Every item in the list will be bound to the corresponding widget instance. Example that uses this functionality: https://github.com/errai/errai/blob/master/errai-jpa/demos/errai-jpa-demo-grocery-list/
          Hide
          csa Christian Sadilek added a comment -

          Resolving since we have a solution for 2.2. There is an opportunity for a higher level API in Errai 3, but that will need more investigation.

          Show
          csa Christian Sadilek added a comment - Resolving since we have a solution for 2.2. There is an opportunity for a higher level API in Errai 3, but that will need more investigation.

            People

            • Assignee:
              csa Christian Sadilek
              Reporter:
              jblinick Josh B
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development