Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SelectItem All Items Selected Default

    Is there a way to have the SelectItem who's default is to have ALL items selected show all of the items "checked" instead of all of them "unchecked"?

    This was usability feedback we received from users who I am assuming were expecting the way Excel shows all items selected for its filtering.

    #2
    You can set the SelectItem's value (using setValue()) to the list of all the values if you want them to show up checked.

    Comment


      #3
      Thanks for the quick reply.

      This is connected to an options datasource to get its values and for some cases there are quite a lot of items in the drop down.

      Is there a single call to set all of them or would I have to determine a way to loop through all of them?

      Thanks again,
      Patrick

      Comment


        #4
        Well, we would actually recommend not trying to change the default behavior. Honestly if you interviewed another set of users, you might well find them holding the reverse opinion.

        And, if it's a large list and you want to include only one option from it, then the user is going to need to uncheck all the other items, which seems laborious.

        And, if you set things up so that all items are selected, then the closed SelectItem is going to reflect that - it will show a value like "option1, option2, option3, ..." etc. And it will submit such all values in the criteria as well, resulting in an unnecessarily complex SQL query.

        But if you are completely committed to go down this patch, then you need to use DataSource.fetchData() on the optionDataSource to retrieve all records, traverse these records to get all the values for the field that the optionDataSource is showing, form an array and supply this to setValues().

        Comment

        Working...
        X