ICEfaces
  1. ICEfaces
  2. ICE-3741

Add support for using mouse click + "shift" and "ctrl" keys to select multiple rows in dataTable

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8RC1, 1.8
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      ANY
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      You might want to achieve this feature on the application level as a workaround. For example, you could have a selectManyMenu component with row identifiers as options. then you could perform mouse click + "shift" key operation to select multiple options and then reflect them to the actual dataTable with ice:rowSelector component.
      Show
      You might want to achieve this feature on the application level as a workaround. For example, you could have a selectManyMenu component with row identifiers as options. then you could perform mouse click + "shift" key operation to select multiple options and then reflect them to the actual dataTable with ice:rowSelector component.

      Description

      when use rowselecting dataTable, we could select a row and press "shift" key then select another row then all rows in between will be selected.

        Issue Links

          Activity

          Sam Xiao created issue -
          Sam Xiao made changes -
          Field Original Value New Value
          Support Case References https://www.icesoft.ca:4443/supportilla/show_bug.cgi?id=5350
          Sam Xiao made changes -
          Workaround Description You might want to achieve this feature on the application level as a workaround. For example, you could have a selectManyMenu component with row identifiers as options. then you could perform mouse click + "shift" key operation to select multiple options and then reflect them to the actual dataTable with ice:rowSelector component.
          Workaround Exists [Yes]
          Hide
          Paul van Rossem added a comment -
          Show
          Paul van Rossem added a comment - See also http://jira.icefaces.org/browse/ICE-2001
          Ken Fyten made changes -
          Link This issue duplicates ICE-2001 [ ICE-2001 ]
          Ken Fyten made changes -
          Assignee Ken Fyten [ ken.fyten ]
          Ken Fyten made changes -
          Salesforce Case []
          Fix Version/s 1.8DR#3 [ 10143 ]
          Assignee Priority P3
          Assignee Ken Fyten [ ken.fyten ] Adnan Durrani [ adnan.durrani ]
          Ken Fyten made changes -
          Link This issue is duplicated by ICE-3849 [ ICE-3849 ]
          Hide
          Mark Collette added a comment -

          java.awt.List has these two methods, showing their later addition of supporting multiple selection
          int getSelectedIndex()
          int[] getSelectedIndexes()

          We should probably follow a similar approach, and have clickedRow:int and clickRows:int[]

          Show
          Mark Collette added a comment - java.awt.List has these two methods, showing their later addition of supporting multiple selection int getSelectedIndex() int[] getSelectedIndexes() We should probably follow a similar approach, and have clickedRow:int and clickRows:int[]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #18168 Wed Jan 14 05:43:41 MST 2009 adnan.durrani Fix for ICE-3741 (support of mouse click + "shift" key to select multiple rows in dataTable)
          New enhancedMultiple attribute added.
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/RowSelector.java
          Commit graph MODIFY /icefaces/trunk/icefaces/bridge/lib/extras/extras.js
          Commit graph MODIFY /icefaces/trunk/icefaces/samples/component-showcase/common-src/org/icefaces/application/showcase/view/resources/messages_es.properties
          Commit graph MODIFY /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-rowselector-props.xml
          Commit graph MODIFY /icefaces/trunk/icefaces/samples/component-showcase/common-src/org/icefaces/application/showcase/view/resources/messages_en.properties
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/renderkit/TableRenderer.java
          Commit graph MODIFY /icefaces/trunk/icefaces/samples/component-showcase/common-web/WEB-INF/includes/examples/custom/dataTable-rowSelection.jspx
          Commit graph MODIFY /icefaces/trunk/icefaces/samples/component-showcase/common-src/org/icefaces/application/showcase/view/bean/examples/component/rowSelector/RowSelectController.java
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/RowSelectorEvent.java
          Adnan Durrani made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          Adnan Durrani added a comment -

          revision: 18168

          New enhancedMultiple boolean attribute added. When true, it offers following selection behaviour:

          • "Click" selects clicked row and deselects rest
          • "Click + Ctrl" flip the selection of clicked row and keeps previous selection intact
          • "Click + Shift" selects all rows from last clicked row to newly clicked row, and deselect rest
          • "Click + Shift + Ctrl" selects all rows from last clicked row to newly clicked row and keeps previous selection intact
          Show
          Adnan Durrani added a comment - revision: 18168 New enhancedMultiple boolean attribute added. When true, it offers following selection behaviour: "Click" selects clicked row and deselects rest "Click + Ctrl" flip the selection of clicked row and keeps previous selection intact "Click + Shift" selects all rows from last clicked row to newly clicked row, and deselect rest "Click + Shift + Ctrl" selects all rows from last clicked row to newly clicked row and keeps previous selection intact
          Adnan Durrani made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Adnan Durrani added a comment -

          Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\bridge\lib\extras\extras.js
          Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\RowSelector.java
          Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\RowSelectorEvent.java
          Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\renderkit\TableRenderer.java
          Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-rowselector-props.xml
          Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-src\org\icefaces\application\showcase\view\bean\examples\component\rowSelector\RowSelectController.java
          Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-src\org\icefaces\application\showcase\view\resources\messages_en.properties
          Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-src\org\icefaces\application\showcase\view\resources\messages_es.properties
          Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-web\WEB-INF\includes\examples\custom\dataTable-rowSelection.jspx
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\RowSelectorEvent.java
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-src\org\icefaces\application\showcase\view\resources\messages_es.properties
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-src\org\icefaces\application\showcase\view\bean\examples\component\rowSelector\RowSelectController.java
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-web\WEB-INF\includes\examples\custom\dataTable-rowSelection.jspx
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-rowselector-props.xml
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\bridge\lib\extras\extras.js
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\renderkit\TableRenderer.java
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-src\org\icefaces\application\showcase\view\resources\messages_en.properties
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\RowSelector.java
          Completed: At revision: 18168

          Show
          Adnan Durrani added a comment - Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\bridge\lib\extras\extras.js Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\RowSelector.java Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\RowSelectorEvent.java Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\renderkit\TableRenderer.java Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-rowselector-props.xml Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-src\org\icefaces\application\showcase\view\bean\examples\component\rowSelector\RowSelectController.java Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-src\org\icefaces\application\showcase\view\resources\messages_en.properties Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-src\org\icefaces\application\showcase\view\resources\messages_es.properties Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-web\WEB-INF\includes\examples\custom\dataTable-rowSelection.jspx Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\RowSelectorEvent.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-src\org\icefaces\application\showcase\view\resources\messages_es.properties Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-src\org\icefaces\application\showcase\view\bean\examples\component\rowSelector\RowSelectController.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-web\WEB-INF\includes\examples\custom\dataTable-rowSelection.jspx Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component-metadata\src\main\resources\conf\ice_cust_properties\cust-rowselector-props.xml Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\bridge\lib\extras\extras.js Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\renderkit\TableRenderer.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\samples\component-showcase\common-src\org\icefaces\application\showcase\view\resources\messages_en.properties Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\RowSelector.java Completed: At revision: 18168
          Hide
          Ken Fyten added a comment -

          Need to add support for the Mac "Command" key to be used instead of the CTRL key (same functionality).

          Here is a reference to the relevant keycodes, etc.: http://unixpapa.com/js/key.html

          Note the section that states:

          "On keydown and keyup, the event objects also have flags that indicate which modifier keys were being pressed when the key was typed. These are:

          event.shiftKey
          event.ctrlKey
          event.altKey
          event.metaKey

          These all have true or false values. According to the DOM 3 standard, on the Macintosh, the Option key should activate event.altKey and the Command key should activate event.metaKey. These attributes seem to work correctly on all modern browsers tested, except event.metaKey is undefined in all versions IE. There is some freakishness in obsolete browsers that can probably be ignored these days. In Macintosh versions of IE, the Command key sets event.ctrlKey and the Control key does nothing. In Netscape 4, none of these attributes existed and the event.modifiers attribute needed to be used instead."

          Show
          Ken Fyten added a comment - Need to add support for the Mac "Command" key to be used instead of the CTRL key (same functionality). Here is a reference to the relevant keycodes, etc.: http://unixpapa.com/js/key.html Note the section that states: "On keydown and keyup, the event objects also have flags that indicate which modifier keys were being pressed when the key was typed. These are: event.shiftKey event.ctrlKey event.altKey event.metaKey These all have true or false values. According to the DOM 3 standard, on the Macintosh, the Option key should activate event.altKey and the Command key should activate event.metaKey. These attributes seem to work correctly on all modern browsers tested, except event.metaKey is undefined in all versions IE. There is some freakishness in obsolete browsers that can probably be ignored these days. In Macintosh versions of IE, the Command key sets event.ctrlKey and the Control key does nothing. In Netscape 4, none of these attributes existed and the event.modifiers attribute needed to be used instead."
          Ken Fyten made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Assignee Priority P3 P2
          Ken Fyten made changes -
          Summary support of mouse click + "shift" key to select multiple rows in dataTable Add support for using mouse click + "shift" and "ctrl" keys to select multiple rows in dataTable
          Salesforce Case []
          Hide
          Ken Fyten added a comment -

          Also need to add this new feature the Description page (comp. showcase) for this component.

          Show
          Ken Fyten added a comment - Also need to add this new feature the Description page (comp. showcase) for this component.
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #18201 Wed Jan 21 07:16:40 MST 2009 adnan.durrani MAC key support added to the rowSelection. Related to ICE-3741.
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/bridge/lib/extras/extras.js
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #18202 Wed Jan 21 07:28:41 MST 2009 adnan.durrani eultipleEnhancement description added to the component-showcase docs. Related to ICE-3741
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/component/doc/tableRowSelectionDoc.html
          Commit graph MODIFY /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-rowselector-props.xml
          Hide
          Adnan Durrani added a comment -

          Mac key support added.

          Trunk: revision 18201

          Show
          Adnan Durrani added a comment - Mac key support added. Trunk: revision 18201
          Hide
          Adnan Durrani added a comment -

          Doc added :
          svn\ossrepo\icefaces\trunk\icefaces\component\doc\tableRowSelectionDoc.html
          Trunk: revision 18202

          Show
          Adnan Durrani added a comment - Doc added : svn\ossrepo\icefaces\trunk\icefaces\component\doc\tableRowSelectionDoc.html Trunk: revision 18202
          Hide
          Krashan Brahmanjara added a comment -

          I see that on every row you add two hidden inputs. I suppose that better solution will be enabling this part of code only if multiselect is enabled.
          if (rowSelectorFound) {
          > if (rowSelector.isEnhancedMultiple())

          { Element ctrlKeyEle = domContext.createElement(HTML.INPUT_ELEM); ctrlKeyEle.setAttribute(HTML.TYPE_ATTR, "hidden"); ctrlKeyEle.setAttribute(HTML.ID_ATTR, paramId + "ctrKy"); ctrlKeyEle.setAttribute(HTML.NAME_ATTR, paramId + "ctrKy"); Element shiftKeyEle = domContext.createElement(HTML.INPUT_ELEM); shiftKeyEle.setAttribute(HTML.TYPE_ATTR, "hidden"); shiftKeyEle.setAttribute(HTML.ID_ATTR, paramId + "sftKy"); shiftKeyEle.setAttribute(HTML.NAME_ATTR, paramId + "sftKy"); tBody.appendChild(ctrlKeyEle); tBody.appendChild(shiftKeyEle); > }

          Also instead hidden inputs javasript array can be used. But this is feature request only for performance issues.

          Show
          Krashan Brahmanjara added a comment - I see that on every row you add two hidden inputs. I suppose that better solution will be enabling this part of code only if multiselect is enabled. if (rowSelectorFound) { > if (rowSelector.isEnhancedMultiple()) { Element ctrlKeyEle = domContext.createElement(HTML.INPUT_ELEM); ctrlKeyEle.setAttribute(HTML.TYPE_ATTR, "hidden"); ctrlKeyEle.setAttribute(HTML.ID_ATTR, paramId + "ctrKy"); ctrlKeyEle.setAttribute(HTML.NAME_ATTR, paramId + "ctrKy"); Element shiftKeyEle = domContext.createElement(HTML.INPUT_ELEM); shiftKeyEle.setAttribute(HTML.TYPE_ATTR, "hidden"); shiftKeyEle.setAttribute(HTML.ID_ATTR, paramId + "sftKy"); shiftKeyEle.setAttribute(HTML.NAME_ATTR, paramId + "sftKy"); tBody.appendChild(ctrlKeyEle); tBody.appendChild(shiftKeyEle); > } Also instead hidden inputs javasript array can be used. But this is feature request only for performance issues.
          Hide
          Ken Fyten added a comment -

          Confirmed that the Mac Command key is working as expected.

          Show
          Ken Fyten added a comment - Confirmed that the Mac Command key is working as expected.
          Ken Fyten made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Assignee Priority P2
          Resolution Fixed [ 1 ]
          Hide
          Adnan Durrani added a comment -

          Hi Krashan Brahmanjara,

          Sorry to say that you have got some misunderstanding, there are only two hidden fields added per table, not per row.

          Thanks,
          Adnan

          Show
          Adnan Durrani added a comment - Hi Krashan Brahmanjara, Sorry to say that you have got some misunderstanding, there are only two hidden fields added per table, not per row. Thanks, Adnan
          Hide
          Mandeep Hayher added a comment -

          Tested successfully on ICEFaces1.8 RC1 build2, jsp version component-showcase on tomcat5 server (windows machine).

          Show
          Mandeep Hayher added a comment - Tested successfully on ICEFaces1.8 RC1 build2, jsp version component-showcase on tomcat5 server (windows machine).
          Ken Fyten made changes -
          Fix Version/s 1.8 [ 10161 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Adnan Durrani [ adnan.durrani ]
          Hide
          Joanne Bai added a comment -

          QA used JSP component-showcase and verified the fix again on ICEfaces trunk revision 18864

          Show
          Joanne Bai added a comment - QA used JSP component-showcase and verified the fix again on ICEfaces trunk revision 18864

            People

            • Assignee:
              Unassigned
              Reporter:
              Sam Xiao
            • Votes:
              6 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: