Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-628

BeanPropertySelectionModel

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.0
    • 4.1
    • Framework
    • None

    Description

      Sometimes it's useful to bind a list of JavaBeans to a PropertySelect, and have Tapestry display a property (labelProperty), and use another property as the selected value (valueProperty). That would allow us to include database lists (probably instantiated using Hibernate or some other ORM) directly on the page, as model for the SELECT.

      A simple implementation would go like this:

      public class BeanPropertySelectionModel<E> implements IPropertySelectionModel {
      public BeanPropertySelectionModel(List<E> options, String labelProperty, String valueProperty);

      public String getLabel(int index);

      public E getOption(int index);
      }

      Attachments

        1. BeanPropertySelectionModel.java.patch
          4 kB
          Leonardo Quijano Vincenzi

        Activity

          People

            Unassigned Unassigned
            lquijano Leonardo Quijano Vincenzi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: