ICEfaces
  1. ICEfaces
  2. ICE-6067

CoreComponentUtils.findComponent(UIComponent,String) endsWith

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha3
    • Fix Version/s: 2.0-Beta2, 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      icefaces2

      Description

      CoreComponentUtils.findComponent(UIComponent uiComponent, String componentId) has a bug where the id matching uses String.endsWith, which erroneously matches components when a component id ends with a substring that is equal to the id of another component. A concrete example is in the forum post.

                 } else if (child.getId() != null && componentId.endsWith(child.getId())) {

        Activity

        Hide
        Deryk Sinotte added a comment -

        Source and pre-built .war file for Glassfish 3 that exercises findComponent in UIData scenarios.

        Show
        Deryk Sinotte added a comment - Source and pre-built .war file for Glassfish 3 that exercises findComponent in UIData scenarios.
        Hide
        Deryk Sinotte added a comment -

        Changed CoreComponentUtils from:

        } else if (child.getId() != null && componentId.endsWith(child.getId()))

        { to }

        else if (child.getId() != null && componentId.equals(child.getId())) {

        I've attached the test case that I used to verify the change fixes the original problem with the datapaginator id as well as a couple of other scenarios that might have been impacted by the change.

        Show
        Deryk Sinotte added a comment - Changed CoreComponentUtils from: } else if (child.getId() != null && componentId.endsWith(child.getId())) { to } else if (child.getId() != null && componentId.equals(child.getId())) { I've attached the test case that I used to verify the change fixes the original problem with the datapaginator id as well as a couple of other scenarios that might have been impacted by the change.

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Mark Collette
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: