SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.9k stars 1.23k forks source link

sap.m.Input control returns an error when a non-text control, such as sap.m.Avatar, is placed in the first cell. #4082

Closed yurakovay closed 1 week ago

yurakovay commented 1 week ago

OpenUI5 version: 1.124.0, in 1.125.1 also Browser/version (+device/version): Chrome Version 126.0.6478.126

URL (minimal example if possible): https://sapui5.hana.ondemand.com/sdk/#/entity/sap.m.Input/sample/sap.m.sample.InputKeyValueTabularSuggestions User/password (if required and possible - do not post any confidential information here):

Steps to reproduce the problem:

  1. In sap.m.Input in suggestion rows add in first column sap.mAvatar control (or any non-text control)
  2. Try to select any item from suggestions
  3. Look at the dev tools, this action returns an error "aCells[0].getText is not a function"

What is the expected result? Use Avatar as a first column in suggestion rows without errors

What happens instead? Error: "aCells[0].getText is not a function"

Any other information? (attach screenshot if possible) image

nikoletavnv commented 1 week ago

Dear @yurakovay,

I have checked the example and the problem arises from how the suggestionRowValidator function is defined in this example. Please take a look at C.controller.js file and the validator function here: https://sapui5.hana.ondemand.com/sdk/#/entity/sap.m.Input/sample/sap.m.sample.InputKeyValueTabularSuggestions/code

The validation function returns sap.ui.core.Item from the text fields of column 1 and column 0. In your example you have set sap.m.Avatar in column 0, so it tries to get the text from it, and it does not have such property. You can either rewrite the validation to work with column 1 and column 2 now, or you can validate your entry on other properties of the Avatar control( not a text field ).

Kind regards, Nikoleta Terzieva