ICEfaces
  1. ICEfaces
  2. ICE-9208

REGRESSION: ace:autoCompleteEntry > Input value gets transfered to newly added component in dataTable

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: EE-3.3.0.GA, 4.0.BETA, 4.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      ICEfaces3 trunk revision# 34488
      All browsers
    • Assignee Priority:
      P2

      Description

      When adding a new autoCompleteEntry component to the top of a table the value of the top most autoCompleteEntry gets moved to the newly added autoCompleteEntry. See screenshot - The arrow indidicates pushing the 'Add' button to add a new row to the top of the table. Notice the Teaberry value has transferred to the newly added component. The same behaviour can not be seen when adding a row to the bottom of the table.

      To reproduce:
      1) Build / deploy test app located at: http://server.ice:8888/svn/repo/qa/trunk/Regression-Icefaces2/Sparkle/Nightly/autoCompleteEntry
      2) Navigate to: AutoCompleteEntry in Table (Add row to the top) test
      3) Type a value autoCompleteEntry at the top of the table
      4) Click Add button to add a new row

        Activity

        Cruz Miraback created issue -
        Cruz Miraback made changes -
        Field Original Value New Value
        Summary ace:autoCompleteEntry > Input value gets transfered to newly added component in dataTable REGRESSION: ace:autoCompleteEntry > Input value gets transfered to newly added component in dataTable
        Cruz Miraback made changes -
        Component/s ACE-Components [ 10050 ]
        Cruz Miraback made changes -
        Attachment screenshot-1.jpg [ 15831 ]
        Ken Fyten made changes -
        Assignee Arturo Zambrano [ artzambrano ]
        Affects Version/s 3.2 [ 10338 ]
        Affects Version/s 3.3 [ 10370 ]
        Assignee Priority P2 [ 10011 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #34530 Thu Apr 25 09:48:19 MDT 2013 art.zambrano ICE-9208 added logic to decide whether to render the 'value' or the 'text' property, and to detect programmatic value changes
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/autocompleteentry/AutoCompleteEntryMeta.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/autocompleteentry/AutoCompleteEntryRenderer.java
        Hide
        Arturo Zambrano added a comment - - edited

        Committed fix at revision 34530.

        The issue was cause because the 'text' component field, which acts as a secondary value property, was always being rendered. Since 'text' is just a component field and not a property, there's no way to bind its value to a property in a backing bean, so the component always retained the same value for this field. It seems that when adding rows to the top, the components at the top are actually the same instances they were before those rows were added. Then, the iterative container reassigns the values, according to the underlying model, but other properties of the component THAT AREN'T BOUND TO A BEAN are retained the way they are, as in the case of the 'text' field.

        Many different approaches were attempted before figuring out the real situation. Eventually, upgrading the 'text' @Field to a @Property in the Meta class, and binding its value to another property in the underlying data object (Employee in the test app), revealed that if the property is bound, then it is updated correctly, since the actual 'value' property was always updated correctly, but since the component used to render the 'text' property only, it appeared as if the value of the component at the top got added to the newly added row. So, this was fixed by deciding when to render the actual 'value' property and by deciding when to clear the 'text' field. This fix incidentally fixes the issue of not being able to programmatically change the (displayed) value of the component.

        Show
        Arturo Zambrano added a comment - - edited Committed fix at revision 34530. The issue was cause because the 'text' component field, which acts as a secondary value property, was always being rendered. Since 'text' is just a component field and not a property, there's no way to bind its value to a property in a backing bean, so the component always retained the same value for this field. It seems that when adding rows to the top, the components at the top are actually the same instances they were before those rows were added. Then, the iterative container reassigns the values, according to the underlying model, but other properties of the component THAT AREN'T BOUND TO A BEAN are retained the way they are, as in the case of the 'text' field. Many different approaches were attempted before figuring out the real situation. Eventually, upgrading the 'text' @Field to a @Property in the Meta class, and binding its value to another property in the underlying data object (Employee in the test app), revealed that if the property is bound, then it is updated correctly, since the actual 'value' property was always updated correctly, but since the component used to render the 'text' property only, it appeared as if the value of the component at the top got added to the newly added row. So, this was fixed by deciding when to render the actual 'value' property and by deciding when to clear the 'text' field. This fix incidentally fixes the issue of not being able to programmatically change the (displayed) value of the component.
        Arturo Zambrano made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Arturo Zambrano added a comment -

        Testing notes: Just test the specific use case and run all regression tests to see if these changes caused any regressions.

        Show
        Arturo Zambrano added a comment - Testing notes: Just test the specific use case and run all regression tests to see if these changes caused any regressions.
        Ken Fyten made changes -
        Fix Version/s EE-3.3.0.GA [ 10572 ]
        Ken Fyten made changes -
        Fix Version/s 4.0 [ 11382 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Cruz Miraback
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: