SAP Knowledge Base Article - Preview

2965945 - SAPUI5: Error with MultiComboBox and Suspend: Error: Cannot read property 'focus' of undefined at f.t.onAfterRenderingList

Symptom

  • There is an error in our Fiori applications that the reselection of a value from a MultiCombobox does not work
  • When tested, the error is found and occurs only after SAPUI 1.77.2.
  • The application has the following:
    • It is using the SAPUI5 MultiComboBox for filtering in an Analytic Page
    • The user can select different values here
    • Special feature, the MultiComboBox loads the data lazy from the ODATA service, i.e. the items are suspended in XML
    • By clicking on the ComboBox the function "onResumeItems" is called, which resumes the items (available in online blogs)
    • So far we had no problem with this procedure
    • But after 1.77.2 the following problem occurs
      • When opening the MultiComboBox for the first time you can still select the values
      • If you open the ComboBox again, no selection is possible, because the ComboBox is closed immediately
      • This application works in SAPUI5 1.77.2
      • With other MultiComboBoxes that do not use this lazy loading (Suspend = true) it works
      • As a hotfix solution, the design team is using SAPUI5 version 1.77.2 so that users are not affected by this error
      • ~~~~~~~Example Definition of the MultiComboBox in the XML view ~~~~
        <MultiComboBox xmlns="sap.m" id="component" items="{path: '/ComponentView', sorter: {path: 'component'}, suspended: true}" loadItems=".onResumeItems" selectionFinish=".onApplyFilter">    <Item xmlns="sap.ui.core" key="{component}" text="{component}"/> </MultiComboBox> Function for resuming the suspended items on click

        /** * Resume the selection of the assemblyLines (Lazy loading). * @param {sap.ui.base.Event} oEvent Event */ onResumeItems: function (oEvent) {  try {   var oItems = oEvent.getSource().getBinding("items");   if (oItems.isSuspended()) {     oItems.resume();   }  } catch (err) {   Log.warning("Combobox " + oEvent.getSource().getId() + " failed to resume ready: " + err);  } },

        ~~~~~~~~Error in Chrome Console~~~

        Error in Chrome Console after the click on the MultiComboBox

        2020-08-21 11:09:39.155375 FocusItem: 1 iFocusedIndex: 1 - focusItem ItemNavigation Log-dbg.js:460 2020-08-21 11:09:39.157114 Set Focus on ID: __item67 - focusItem ItemNavigation Log-dbg.js:460 2020-08-21 11:09:39.170014 FocusItem: 1 iFocusedIndex: 1 - focusItem ItemNavigation Log-dbg.js:460 2020-08-21 11:09:39.171590 Set Focus on ID: __item67 - focusItem ItemNavigation MultiComboBox-dbg.js:2284 Uncaught TypeError: Cannot read property 'focus' of undefined at f.t.onAfterRenderingList (MultiComboBox-dbg.js:2284) at j (Element-dbg.js:325) at f.d._handleEvent (Element-dbg.js:338) at _ (RenderManager-dbg.js:1123) at a1 (RenderManager-dbg.js:1171) at R.render (RenderManager-dbg.js:1293) at Function.U.rerenderControl (UIArea-dbg.js:749) at f.c.rerender (Control-dbg.js:384) at constructor.U.rerender (UIArea-dbg.js:688) at constructor.Core.renderPendingUIUpdates (Core-dbg.js:2816)  


Read more...

Environment

 SAPUI5 1.77

Product

SAPUI5 1.0

Keywords

"Drop Down selection","After selecting the drop down once it does not work","MultiComboBox","MultiComboBox selection","MultiComboBox Suspend" , KBA , CA-UI5-CTR-RIL , SAP UI5 Controls Rila team , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.