Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregation binding in JSON View #2972

Closed
Tukutupap opened this issue Aug 5, 2020 · 3 comments
Closed

Aggregation binding in JSON View #2972

Tukutupap opened this issue Aug 5, 2020 · 3 comments

Comments

@Tukutupap
Copy link

OpenUI5 version: From v1.64 it doesn't work.

Browser/version (+device/version): Any browser.

Any other tested browsers/devices(OK/FAIL):

URL (minimal example if possible): https://jsbin.com/medenuq/edit?html,console,output

User/password (if required and possible - do not post any confidential information here):

Steps to reproduce the problem:
The example is set by default to version 1.63 so it will work. Replace it to 1.64 and it will stop working.

What is the expected result? The binding works and two rows of data are rendered.

What happens instead? No table is rendered.

Any other information? (attach screenshot if possible):

I've been struggling with this issue and I was wondering if any of you would know what is going on here.

Working on a JSON view, which is basically a table with 1 column (working on a proof of concept). This column has to show a date so I use a DatePicker as a template and have a binding to my model.
The error I am getting is the following: Loading of data failed: Error: "[object Object]" is not valid for aggregation "template" of Element sap.ui.table.Column

The error happens when trying to process this piece:

{
"path": "Date",
"type": "sap.ui.model.type.String"
}

I have not been able to figure out what changed, if I'm doing something wrong or if this is an actual bug.

@codeworrior
Copy link
Member

codeworrior commented Aug 5, 2020

That's indeed a regression that was introduced when static bindings (bindings that produce a static value) have been implemented with c7b953e (1.61) and extended to aggregation bindings with an altType (with f872ee2 in 1.64).

Since those changes, an object value for an aggregation will be interpreted as a binding when it contains a property named value.

Until this is fixed, you can work around it by setting the marker property ui5object in the settings for your DatePicker:

	"template": {
		"Type": "sap.m.DatePicker",
		"ui5object": true,       // <-- marker property
		"editable": false,
		"displayFormat": "MM/dd/yyyy",
		"valueFormat": "yyyyMMdd",
		"value": {
			"path": "Date",
			"type": "sap.ui.model.type.String"
		}
	}

This marker property indicates that the object should not be interpreted as binding (the marker is removed by the framework before crating the DatePicker).

@codeworrior codeworrior added the bug label Aug 5, 2020
@Tukutupap
Copy link
Author

Thanks codeworrior!

@dobrinyonkov
Copy link
Contributor

Hi @Tukutupap,

Thank you for sharing this finding. I've created an internal incident 2080356736. The status of the issue will be updated here in GitHub.

Regards,
Dobrin

openui5bot pushed a commit that referenced this issue Dec 15, 2020
Fixes issue where aggregation objects which have a value
property were wrongly interpreted as bindings.

BCP: 2080356736
Fixes: #2972

Change-Id: I1882cfe12d52cfbdc2aea1073959c3f12840b9bc
(cherry picked from commit 56a3a25)
CR-Id: 002075125900004538032020
openui5bot pushed a commit that referenced this issue Dec 15, 2020
Fixes issue where aggregation objects which have a value
property were wrongly interpreted as bindings.

BCP: 2080356736
Fixes: #2972

Change-Id: I1882cfe12d52cfbdc2aea1073959c3f12840b9bc
CR-Id: 002075125900004537662020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants