ICEfaces
  1. ICEfaces
  2. ICE-2758

SelectInputDate uses unsafe method to match component id when processing the calendar button clicked event

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.2
    • Fix Version/s: 1.7.2
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      Windows, JBoss 4.2
    • Workaround Exists:
      Yes
    • Workaround Description:
      Make sure that no selectInputDate exists with a clientId which is a substring of another selectInputDate's clientId.

      Description

      com.icesoft.faces.component.selectinputdate.SelectInputDateRenderer#checkLink() checks whether the calendar button that was clicked is the same button that corresponds to the current SelectInputDate component. It does this by looking for the clientId of the SelectInputDate component as a substring of the linkId that was clicked. This approach produces a false positive if another selectInputDate component exists that has a client id which is a superstring of another selectInputDate component.

      To reproduce, create two selectInputDates side by side. Give the first an id of "test", and the second an id of "test2". Click the calendar button of the "test2" component. The popup for both "test" and "test2" will appear.

      This is because the client of "test" is a substring of the clicked link id, which is "test2_calendarButton". Therefore the test in com.icesoft.faces.component.selectinputdate.SelectInputDateRenderer#checkLink() returns true.

        Activity

        User Ansel1 created issue -
        Ken Fyten made changes -
        Field Original Value New Value
        Fix Version/s 1.7.2 [ 10130 ]
        Assignee Priority P2
        Assignee Mark Collette [ mark.collette ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #17440 Mon Aug 25 17:10:01 MDT 2008 mark.collette ICE-2758 : SelectInputDate uses unsafe method to match component id when processing the calendar button clicked event
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/selectinputdate/SelectInputDateRenderer.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #17441 Mon Aug 25 17:19:23 MDT 2008 mark.collette ICE-2758 : SelectInputDate uses unsafe method to match component id when processing the calendar button clicked event
        Files Changed
        Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/component/src/com/icesoft/faces/component/selectinputdate/SelectInputDateRenderer.java
        Hide
        Mark Collette added a comment -

        I could not reproduce the bug with one selectInputdate having the id "date" and the other having the id "date2". Inspection of the code shows that case to not be an issue, in the current codebase. There is a case where it will match if the id has a trailing underscore plus additional letters, like "date_" and "date_something" not working properly with "date". So, I've fixed that.

        TRUNK
        Subversion 17440
        ICEfaces 1.7 branch
        Subversion 17441
        icefaces\component\src\com\icesoft\faces\component\selectinputdate\SelectInputDateRenderer.java

        Show
        Mark Collette added a comment - I could not reproduce the bug with one selectInputdate having the id "date" and the other having the id "date2". Inspection of the code shows that case to not be an issue, in the current codebase. There is a case where it will match if the id has a trailing underscore plus additional letters, like "date_" and "date_something" not working properly with "date". So, I've fixed that. TRUNK Subversion 17440 ICEfaces 1.7 branch Subversion 17441 icefaces\component\src\com\icesoft\faces\component\selectinputdate\SelectInputDateRenderer.java
        Mark Collette made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Ken Fyten made changes -
        Fix Version/s 1.7.2RC1 [ 10140 ]
        Fix Version/s 1.7.2 [ 10130 ]
        Hide
        Mark Collette added a comment -

        ansel1, have you tested this fix against your original issue? If it's still broken, can you provide a test case?

        Show
        Mark Collette added a comment - ansel1, have you tested this fix against your original issue? If it's still broken, can you provide a test case?
        Hide
        User Ansel1 added a comment -

        Sorry, we haven't tested this fix. We went with the work around and never looked at it again.

        Show
        User Ansel1 added a comment - Sorry, we haven't tested this fix. We went with the work around and never looked at it again.
        Ken Fyten made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 1.7.2 [ 10130 ]
        Fix Version/s 1.7.2RC1 [ 10140 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P2
        Assignee Mark Collette [ mark.collette ]

          People

          • Assignee:
            Unassigned
            Reporter:
            User Ansel1
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: