2 Replies Latest reply on Dec 28, 2012 10:06 PM by ti*422354*im

    CheckboxListCell for ListView

      Dear all,

      currently I have to program a ListView that has for every row a checkbox and a customized label. Can someone please post an example how to use it. The docs and "google is your friend" don't show a working example.

      - There is a custom class " RollenDTO" that have a name-property
      - The name-property shall be the text of the label of every row in the ListView
      - Additionally there should be a Checkbox in every row to select or unselect the "roles"

      Thank you and regards Tim
        • 1. Re: CheckboxListCell for ListView
          Do you have a "selected" property in your custom RollenDTO class? You will either need this, or some data structure that specifies the selected state of RollenDTO instances.

          Once you get the data model right, the rest usually follows fairly easily.
          1 person found this helpful
          • 2. Re: CheckboxListCell for ListView
            Thank you.

            I wrote now a WrapperClass with a booleanProperty to get the checked status of the chechkbox.
            Furthermore I found an example that I can add a converter class to render the names of the listview rows.

            listView.setCellFactory(CheckBoxListCell.forListView(callback, converter));

            regards Tim.