Announcement Announcement Module
Collapse
No announcement yet.
Displaying a List in the TableFormBuilder Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Displaying a List in the TableFormBuilder

    Hi,
    I have a property in my class that returns a list. I am having trouble displaying the contents of the list in a Form. I am using TableFormBuilder.

    // code snippet
    formBuilder.add(bindingFactory.createBoundComboBox ("shipmentNotesCollection", getShipmentNotes(FileNumber)));


    Also, I just wanted to display the messages, not in a combo box. The displayed messages in not going to be changed.

    Tennyson

  • #2
    It's been a while since I've worked on the UI of our application (which is based on spring-rich), but in the past I've done something like this for lists:
    Code:
    formBuilder.addInScrollPane(bindingFactory.createBoundList("reportRoles", getAvailableRoles(), "name"));
    The "createBoundList" method (in our version of spring-rich anyway) above is to allow selection of roles for a report, so the first parameter is specifying what property is going to hold the selected items (or roles), the second parameter (getAvailableRoles()) is a collection holding the items to show in the list, and the third parameter ("name") is the name of the property for the items in the source list (the list from getAvailableRoles() in this example) that should be displayed in the list. In this example, the "name" property will be queried for each item in this list, and the resulting String is what gets displayed in the UI. As the user selects items in the list, those items will be placed in the "reportRoles" property of the backing form object. If "reportRoles" holds a collection, then the list will allow multiple selection, otherwise the list will allow only single selection and the selected item will be placed directly into the property.
    I should note that the version of spring-rich we are using has "createBoundList" defined in SwingBindingFactory, so the "bindingFactory" above is obtained like so:
    Code:
    SwingBindingFactory bindingFactory = (SwingBindingFactory)getBindingFactory()

    Comment

    Working...
    X