on 2023 Feb 15 12:01 PM
Hi all,
I'm binding the items of a table from the controller, but on doing this I'm getting an extra empty row in the table.
Then I found some references where they define an empty path in the items of the table like this and then as usual bind the data through the controller:
This way I don't get an extra empty row in the table.
Could someone please explain this behavior? And I've seen at many places where they define an empty path like above, what is the purpose of doing this?
Request clarification before answering.
SAPUI5 tries to render the aggregation even if it doesn't have a clear template or binding context. When nothing is bound yet, it still reserves space for one row, leading to an unexpected empty row.
The empty items="" (or items="{ }") in XML view prevents the table from rendering a row before binding is done.
Always define the aggregation structure explicitly when binding from controller code.
This is a common best practice when binding tables dynamically in SAPUI5.
Hope this clears up the behavior!
Best regards,
Abhishek Singh
SAP Fiori | UI5 Developer & Integration Specialist
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
33 | |
22 | |
17 | |
8 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.