ICEfaces
  1. ICEfaces
  2. ICE-11289

allow filterBy attribute to contain multiple values within <ace:column/>

    Details

      Description

      Currently the filterBy attribute allows a single string to be used from a selection of values.

      The use of filtering by multiple values allowing the following valid markup:-
      {code}
      <ace:column>
           filterBy="#{user.firstName} #{user.lastName}"
          filterOptions="#{user.nameOptions}"
      .......
      </ace:column>
      {code}

        Activity

        Judy Guglielmin created issue -
        Judy Guglielmin made changes -
        Field Original Value New Value
        Assignee Arturo Zambrano [ artzambrano ]
        Judy Guglielmin made changes -
        Fix Version/s EE-4.2.0.GA [ 13071 ]
        Ken Fyten made changes -
        Assignee Priority P2 [ 10011 ]
        Hide
        Arturo Zambrano added a comment -

        This improvement seems feasible. I assume that the intention is to filter by one or the other property (e.g. if this string is found in this property or in this other property or... then include this row in the filtered set). The only constraint these properties will have to be of the same type, as specified by the 'type' attribute of the ace:column component.

        The improvement will entail modifying all the FilterConstraint implementations in the org.icefaces.ace.model.filter package to support multiple values, as well as modifying the logic in processing filters to detect the case of having multiple filter values, especially in the PropertyConstraintPredicate class.

        Show
        Arturo Zambrano added a comment - This improvement seems feasible. I assume that the intention is to filter by one or the other property (e.g. if this string is found in this property or in this other property or... then include this row in the filtered set). The only constraint these properties will have to be of the same type, as specified by the 'type' attribute of the ace:column component. The improvement will entail modifying all the FilterConstraint implementations in the org.icefaces.ace.model.filter package to support multiple values, as well as modifying the logic in processing filters to detect the case of having multiple filter values, especially in the PropertyConstraintPredicate class.
        Hide
        Arturo Zambrano added a comment -

        r51457: added 'filter' facet to ace:column in order to arbitrarily specify filtering values

        Show
        Arturo Zambrano added a comment - r51457: added 'filter' facet to ace:column in order to arbitrarily specify filtering values
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #51457 Fri Apr 28 19:25:35 MDT 2017 art.zambrano ICE-11289 added 'filter' facet to ace:column in order to arbitrarily specify filtering values
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/FilterState.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTable.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/column/ColumnMeta.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/datatable/datatable.js
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/datatable/datatable.css
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableMeta.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableHeadRenderer.java
        Hide
        Arturo Zambrano added a comment - - edited

        The filter facet has been implemented and it allows app developers more flexibility in specifying filter values, but there are still internal changes that need to be made in order to fully support the scenarios with which we have been presented. It will depend on what we want to support and how much code we want to modify.

        The two scenarios we are given are (1) the FirstName-LastName scenario and (2) the Multiple Checkboxes scenario to display multiple types.

        Each of those scenarios requires different changes in our code in order to be supported. They aren't the same use case, structurally. We identify that three use cases for which we can add support: one-to-many, many-to-one, and many-to-many.

        Scenario (1) is a one-to-many use case, and scenario (2) is a many-to-one use case, for the reasons that will be explained below. We weren't given a many-to-many scenario, but they could possibly arise as well. So far we only support one-to-one use cases.

        First, we have to understand two key attributes of ace:column involved in filtering: 'filterBy' and 'filterValue'.

        The 'filterBy' attribute has typically been used to specify a single EL expression corresponding to a property in the data object. When processing filters, this attribute is evaluated and the resulting string is compared against the value that was entered by the user. This attribute can actually contain multiple EL expressions, spaces and other characters. In the end it's a string that is formed by evaluating each row's data object.

        The 'filterValue' attribute is the string that will be compared against each string formed by filterBy. This string is typically what the user entered in the textbos or drop-down menu, but it can also be set programmatically, as it should be in the case of using the new filter facet.

        Thus, scenario (1) involves having a single 'filterValue' compared against 2 different 'filterBy' expressions (one for first name and one for last name). Scenario (2) involves having multple filter values (all the different types selected with the checkboxes) compared against a single 'filterBy' expression (the type, in this case).

        Scenario (1) is actually supported now, as long as 'filterMatchMode="contains"' is used, but it wouldn't work if it's set to 'startsWith' or other mode.

        Supporting many-to-one cases is less complicated than supporting one-to-many cases. For 'many-to-one' cases we only need to modify the PropertyConstraintPredicate class to loop through all the filter values. Supporting one-to-many cases involves several structural changes in data table classes.

        From the user perspective, we have to decide how to specify multiple values. One possible way to specify multiple filter values would be to separate them by commas in 'filterBy', but we would have to add another boolean attribute to indicate that this attribute should be interpreted as having multiple values. Another option would be to have a new 'filterValues' attribute to specify a List or an Array of Strings. It would be more complex that simply using the existing attribute. As for multiple 'filterBy' expressions something similar applies.

        Show
        Arturo Zambrano added a comment - - edited The filter facet has been implemented and it allows app developers more flexibility in specifying filter values, but there are still internal changes that need to be made in order to fully support the scenarios with which we have been presented. It will depend on what we want to support and how much code we want to modify. The two scenarios we are given are (1) the FirstName-LastName scenario and (2) the Multiple Checkboxes scenario to display multiple types. Each of those scenarios requires different changes in our code in order to be supported. They aren't the same use case, structurally. We identify that three use cases for which we can add support: one-to-many, many-to-one, and many-to-many. Scenario (1) is a one-to-many use case, and scenario (2) is a many-to-one use case, for the reasons that will be explained below. We weren't given a many-to-many scenario, but they could possibly arise as well. So far we only support one-to-one use cases. First, we have to understand two key attributes of ace:column involved in filtering: 'filterBy' and 'filterValue'. The 'filterBy' attribute has typically been used to specify a single EL expression corresponding to a property in the data object. When processing filters, this attribute is evaluated and the resulting string is compared against the value that was entered by the user. This attribute can actually contain multiple EL expressions, spaces and other characters. In the end it's a string that is formed by evaluating each row's data object. The 'filterValue' attribute is the string that will be compared against each string formed by filterBy. This string is typically what the user entered in the textbos or drop-down menu, but it can also be set programmatically, as it should be in the case of using the new filter facet. Thus, scenario (1) involves having a single 'filterValue' compared against 2 different 'filterBy' expressions (one for first name and one for last name). Scenario (2) involves having multple filter values (all the different types selected with the checkboxes) compared against a single 'filterBy' expression (the type, in this case). Scenario (1) is actually supported now, as long as 'filterMatchMode="contains"' is used, but it wouldn't work if it's set to 'startsWith' or other mode. Supporting many-to-one cases is less complicated than supporting one-to-many cases. For 'many-to-one' cases we only need to modify the PropertyConstraintPredicate class to loop through all the filter values. Supporting one-to-many cases involves several structural changes in data table classes. From the user perspective, we have to decide how to specify multiple values. One possible way to specify multiple filter values would be to separate them by commas in 'filterBy', but we would have to add another boolean attribute to indicate that this attribute should be interpreted as having multiple values. Another option would be to have a new 'filterValues' attribute to specify a List or an Array of Strings. It would be more complex that simply using the existing attribute. As for multiple 'filterBy' expressions something similar applies.
        Hide
        Arturo Zambrano added a comment -

        r51470: added added many-to-one filtering support to ace:dataTable
        r51471: modified filtering demo to show this functionality

        Show
        Arturo Zambrano added a comment - r51470: added added many-to-one filtering support to ace:dataTable r51471: modified filtering demo to show this functionality
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #51470 Thu May 04 15:26:51 MDT 2017 art.zambrano ICE-11289 added added many-to-one filtering support to ace:dataTable
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/FilterState.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTable.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/column/ProxiedBodyColumn.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/util/collections/PropertyConstraintPredicate.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/column/ColumnMeta.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #51471 Thu May 04 15:28:18 MDT 2017 art.zambrano ICE-11289 modified ace:dataTable filtering demo to show many-to-one filtering support
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/samples/showcase/showcase/src/main/java/org/icefaces/samples/showcase/example/ace/dataTable/DataTableFiltering.java
        Commit graph MODIFY /icefaces4/trunk/icefaces/samples/showcase/showcase/src/main/webapp/resources/examples/ace/dataTable/dataTableFiltering.xhtml
        Ken Fyten made changes -
        Fix Version/s EE-3.3.0.GA_P05 [ 13082 ]
        Hide
        Arturo Zambrano added a comment -

        r51484: added listeners to close filter facet when clicking outside of it

        Show
        Arturo Zambrano added a comment - r51484: added listeners to close filter facet when clicking outside of it
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #51484 Mon May 08 16:49:44 MDT 2017 art.zambrano ICE-11289 added listeners to close filter facet when clicking outside of it
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/datatable/datatable.js
        Hide
        Arturo Zambrano added a comment -

        Committed to the 3.3 EE maintenance branch:
        r51487: added fontawesome, since it's needed for this improvement
        r51488: added 'filter' facet to ace:column in order to arbitrarily specify filtering values; added added many-to-one filtering support to ace:dataTable; added listeners to close filter facet when clicking outside of it

        Show
        Arturo Zambrano added a comment - Committed to the 3.3 EE maintenance branch: r51487: added fontawesome, since it's needed for this improvement r51488: added 'filter' facet to ace:column in order to arbitrarily specify filtering values; added added many-to-one filtering support to ace:dataTable; added listeners to close filter facet when clicking outside of it
        Hide
        Arturo Zambrano added a comment -

        r51849: added many-to-one filtering support for all column value types

        Show
        Arturo Zambrano added a comment - r51849: added many-to-one filtering support for all column value types
        Arturo Zambrano made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #51489 Mon May 08 20:48:17 MDT 2017 art.zambrano ICE-11289 added many-to-one filtering support for all column value types
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/util/collections/PropertyConstraintPredicate.java
        Hide
        Liana Munroe added a comment - - edited

        Verified functionality ICEfaces 4 trunk, ICEfaces EE-3.3.0 maintenance branch r51533, Tomcat 8, MS Edge, IE 11, 10, 9, 8, 7, FF 47, Chrome 57.
        Added test apps ICE-11298.jsf to:
        http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/dataTable
        http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces2/Sparkle/Nightly/dataTable

        There is an issue (all browsers) only the very first time that a filter selection is checked and can be seen in the new QA test apps as well as in the showcase demo ace:dataTable > Filtering.
        After making one selection from the Chassis menu the menu closes immediately and does not filter the data. After reopening the menu, it will stay open while making multiple selections. Once the menu is closed again the filtering will occur as expected.

        Show
        Liana Munroe added a comment - - edited Verified functionality ICEfaces 4 trunk, ICEfaces EE-3.3.0 maintenance branch r51533, Tomcat 8, MS Edge, IE 11, 10, 9, 8, 7, FF 47, Chrome 57. Added test apps ICE-11298 .jsf to: http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/dataTable http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces2/Sparkle/Nightly/dataTable There is an issue (all browsers) only the very first time that a filter selection is checked and can be seen in the new QA test apps as well as in the showcase demo ace:dataTable > Filtering. After making one selection from the Chassis menu the menu closes immediately and does not filter the data. After reopening the menu, it will stay open while making multiple selections. Once the menu is closed again the filtering will occur as expected.
        Liana Munroe made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Arturo Zambrano added a comment -

        The above is not really an issue. It's the same situation that we've seen that happens at the very first request when loading a page directly: there's no session created yet, so the first request contains the jsessionid parameter, and that causes the whole form to be updated, so the table is rendered again in it's initial state (with the facet closed). This doesn't happen when loading the main showcase page first and navigating to the demo by clicking the menu on the left or by simply using the jsp redirection technique that we use in most of our apps, including the showcase (response.sendRedirect("x.jsf")).

        Show
        Arturo Zambrano added a comment - The above is not really an issue. It's the same situation that we've seen that happens at the very first request when loading a page directly: there's no session created yet, so the first request contains the jsessionid parameter, and that causes the whole form to be updated, so the table is rendered again in it's initial state (with the facet closed). This doesn't happen when loading the main showcase page first and navigating to the demo by clicking the menu on the left or by simply using the jsp redirection technique that we use in most of our apps, including the showcase (response.sendRedirect("x.jsf")).
        Arturo Zambrano made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Liana Munroe added a comment - - edited

        Tested with ICEfaces 4 trunk r51581 using myfaces 2.2.12 libs. The filter selection issue as seen in my last comment is present even when loading the main showcase page first and navigating to the demo by clicking the menu on the left.
        When using mojarra libs and navigating through the menu the issue is not seen.

        Show
        Liana Munroe added a comment - - edited Tested with ICEfaces 4 trunk r51581 using myfaces 2.2.12 libs. The filter selection issue as seen in my last comment is present even when loading the main showcase page first and navigating to the demo by clicking the menu on the left. When using mojarra libs and navigating through the menu the issue is not seen.
        Liana Munroe made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Arturo Zambrano added a comment -

        r51607: added code to preserve the open/closed state of the filter facet across requests, in order to avoid the facet suddenly close when the whole table markup is updated

        This takes care of the issue with myfaces as well as the issue with mojarra.

        Show
        Arturo Zambrano added a comment - r51607: added code to preserve the open/closed state of the filter facet across requests, in order to avoid the facet suddenly close when the whole table markup is updated This takes care of the issue with myfaces as well as the issue with mojarra.
        Arturo Zambrano made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #51607 Thu Jun 08 12:07:02 MDT 2017 art.zambrano ICE-11289 added code to preserve the open/closed state of the filter facet across requests, in order to avoid the facet suddenly close when the whole table markup is updated
        Files Changed
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/resources/icefaces.ace/datatable/datatable.js
        Commit graph MODIFY /icefaces4/trunk/icefaces/ace/component/src/org/icefaces/ace/component/datatable/DataTableHeadRenderer.java
        Arturo Zambrano made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Liana Munroe added a comment -

        Verified ICEfaces 4 trunk r51622, myfaces and mojarra libs, Tomcat 8, MS Edge, IE 11, 10, 9, 8, FF 47, Chrome 57.

        Show
        Liana Munroe added a comment - Verified ICEfaces 4 trunk r51622, myfaces and mojarra libs, Tomcat 8, MS Edge, IE 11, 10, 9, 8, FF 47, Chrome 57.
        Hide
        Arturo Zambrano added a comment -

        r51632: backported last fix to the 3.3 EE maintenance branch

        Show
        Arturo Zambrano added a comment - r51632: backported last fix to the 3.3 EE maintenance branch
        Arturo Zambrano made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Liana Munroe added a comment -

        Verified ICEfaces EE-3.3.0 maintenance branch r51633, myfaces and mojarra libs, Tomcat 8, MS Edge, IE 11, 10, 9, 8, 7 FF 47, Chrome 57.

        Show
        Liana Munroe added a comment - Verified ICEfaces EE-3.3.0 maintenance branch r51633, myfaces and mojarra libs, Tomcat 8, MS Edge, IE 11, 10, 9, 8, 7 FF 47, Chrome 57.
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Judy Guglielmin
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: