Skip to Content
avatar image
Former Member

Issue with SAPUI5 Table cell value state disappear

Please have a look at this link for more details in stackoverflow and if it doesn't work please copy paste the url below. I have asked this question in more details over there. C

I am adding controls to SAPUI5 table column items via the controller using factory function so that I can apply cross-field validation along with standard control validations. Now the validation is working fine it shows the error message with the red coloured border, but when I move to next control, validation state of control disappear. I noticed that it is happening due to some internal functionality of SAPUI5 where it re-render the table body element of the table in the HTML dom explorer which also get rid of the error classes applied to control. It occurs for the first time, but when I try to change the value again of the same control with an invalid data, it displays the error and keeps the value state with the red border.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • May 14, 2018 at 07:47 AM

    Why your ID is like id: `id_${sId}`, ??



    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 14, 2018 at 11:59 AM

    Hello Atul,

    If you bind valueState with model then the issue will be resolved. The issue is happening because when the control is regenerated, changed property is reset to the initial value.



    Add comment
    10|10000 characters needed characters exceeded

  • May 14, 2018 at 04:21 PM

    why don't you use sap.m.Table..

    Below is the behavior of sap.m.Table and sap.ui.table.Table.... if there are 100 rows of data in the model

    sap.m.Table --> 100 items with unique id will be created (more items..less performance of rendering as DOM increases)

    sap.ui.table.Table --> no. of rows created with unique id = visible row count of table (only visible row count of items are in the DOM...which is good if you have huge amount of data)

    If you still want to use sap.ui.table.Table and have the error state retained after scroll down or scroll up then use the event firstVisibleRowChanged

    In this event handler..get the currently visible rows of data...perform validation and show the error status..

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I have tried it with the sap.m table but the issue is still the same. However I managed to track down the issue. The issue is whenever I change the input field and click on another cell it fires the populateItems event again which renders the input again and loses the state. This is telling me that it is the issue with the library itself or maybe this is an expected behaviour. So I am planning to ask for another solution and close this issue.