ICEfaces
  1. ICEfaces
  2. ICE-7732

ice:selectInputText - getSelectedItem() always returns null when used in a panelTabSet

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: EE-1.8.2.GA_P03
    • Fix Version/s: EE-1.8.2.GA_P04
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      ICEfaces 1.8.x
    • Assignee Priority:
      P1

      Description

      When using a selectInputText component in a panelTabSet, the getSelectedItem() will always return null. This is different behavior then how it reacts outside of the tab set or in an ice-cc:tabView component.

      The getSelectedItem() call is used in the valueChangeListener for the component. When a input is entered in the text field the getSelectedItem() is null which is expected. Once an item is selected it is still returning a null value.
      1. Case10902Example.zip
        320 kB
        Arran Mccullough
      2. Case10902ExampleWAR.zip
        9.70 MB
        Arran Mccullough

        Activity

        Hide
        Mark Collette added a comment -

        The jira where we revamped selectInputText's selectedItem state saving, and first identified the caveat of the SelectItem value needing to be Serializable:

        http://jira.icesoft.org/browse/ICE-1993

        The jira where we added UISeries (ice:panelTabSet, ice:dataTable, etc.) row level state saving support for ice:selectInputText, which means that a selected item won't even last within the lifecycle unless it's Serializable:

        http://jira.icesoft.org/browse/ICE-6137

        Show
        Mark Collette added a comment - The jira where we revamped selectInputText's selectedItem state saving, and first identified the caveat of the SelectItem value needing to be Serializable: http://jira.icesoft.org/browse/ICE-1993 The jira where we added UISeries (ice:panelTabSet, ice:dataTable, etc.) row level state saving support for ice:selectInputText, which means that a selected item won't even last within the lifecycle unless it's Serializable: http://jira.icesoft.org/browse/ICE-6137
        Mark Collette made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Invalid [ 6 ]
        Hide
        Mark Collette added a comment -

        PanelTabSet has modes where it can act as a UIData, and so it uses a special mechanism for row level state saving that affects child components. SelectInputText implements the correct interface to work with this. BUT, the main caveat is that each SelectItem's value must be Serializable. Otherwise SelectInputText will intentionally not store the SelectItem, since that can cause exceptions if JSF decides to serialize the session.

        Working with the test app, the problem was duplicated, as described. Then, I modified the City class to make it Serializable, and then the problem went away.

        Basically, any objects that applications hand over to a UIComponent to operate on, or store, should implement Serializable, since one way or another, any of those objects may be state saved into the session, and the session may be serialized, which will then fail if it's not 100% constituted of Serializable objects.

        Show
        Mark Collette added a comment - PanelTabSet has modes where it can act as a UIData, and so it uses a special mechanism for row level state saving that affects child components. SelectInputText implements the correct interface to work with this. BUT, the main caveat is that each SelectItem's value must be Serializable. Otherwise SelectInputText will intentionally not store the SelectItem, since that can cause exceptions if JSF decides to serialize the session. Working with the test app, the problem was duplicated, as described. Then, I modified the City class to make it Serializable, and then the problem went away. Basically, any objects that applications hand over to a UIComponent to operate on, or store, should implement Serializable, since one way or another, any of those objects may be state saved into the session, and the session may be serialized, which will then fail if it's not 100% constituted of Serializable objects.
        Arran Mccullough made changes -
        Attachment Case10902ExampleWAR.zip [ 14232 ]
        Arran Mccullough made changes -
        Attachment Case10902Example.zip [ 14231 ]
        Arran Mccullough made changes -
        Attachment Case10648ExampleWAR.zip [ 14035 ]
        Arran Mccullough made changes -
        Attachment Case10648Example.zip [ 14034 ]
        Ken Fyten made changes -
        Assignee Priority P2 P1
        Ken Fyten made changes -
        Assignee Priority P3 P2
        Ken Fyten made changes -
        Assignee Priority P2 P3
        Ken Fyten made changes -
        Assignee Adnan Durrani [ adnan.durrani ] Mark Collette [ mark.collette ]
        Ken Fyten made changes -
        Fix Version/s EE-1.8.2.GA_P04 [ 10280 ]
        Assignee Priority P2
        Assignee Adnan Durrani [ adnan.durrani ]
        Arran Mccullough made changes -
        Attachment Case10648Example.zip [ 14034 ]
        Attachment Case10648ExampleWAR.zip [ 14035 ]
        Hide
        Arran Mccullough added a comment -

        Attached test case that shows the issue. This test case uses the autocomplete tutorial.

        welcomeICEfaces.iface - This is where to reproduce the issue. Steps:

        • Enter in 'A' into selectInputText field.
        • ValueChangeListener is called
        • getSelectedItem is null.
        • Select and Item from the list.
        • ValueChangeListener is called.
        • getSelectedItem is still null.

        tabView.iface - This replaces the ice:panelTabSet. This also functions the same as using a selectInputText by itself.

        • Enter in 'A' into selectInputText field.
        • ValueChangeListener is called
        • getSelectedItem is null.
        • Select and Item from the list.
        • ValueChangeListener is called.
        • getSelectedItem is not null.
        Show
        Arran Mccullough added a comment - Attached test case that shows the issue. This test case uses the autocomplete tutorial. welcomeICEfaces.iface - This is where to reproduce the issue. Steps: Enter in 'A' into selectInputText field. ValueChangeListener is called getSelectedItem is null. Select and Item from the list. ValueChangeListener is called. getSelectedItem is still null. tabView.iface - This replaces the ice:panelTabSet. This also functions the same as using a selectInputText by itself. Enter in 'A' into selectInputText field. ValueChangeListener is called getSelectedItem is null. Select and Item from the list. ValueChangeListener is called. getSelectedItem is not null.
        Arran Mccullough made changes -
        Field Original Value New Value
        Salesforce Case [5007000000KFwJJ]
        Arran Mccullough created issue -

          People

          • Assignee:
            Mark Collette
            Reporter:
            Arran Mccullough
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: