cancel
Showing results for 
Search instead for 
Did you mean: 

SAP MDK - How to access object information from a Card Collection?

emorales
Explorer
0 Kudos
532

Hello community !

I have an MDK application which on the home page has a Card Collection:

emorales_0-1726515219157.png

When you click on one of the cards, navigation to a details page is activated:

emorales_1-1726515269234.png

But when I get to this screen, I see everything empty:

emorales_2-1726515360746.jpeg

How can I access the object I select? Is there a way to send the object ID between views and access specific information about a particular object? In the detail view I am using "Key Value Item" type controls.

Navigation is simple, I don't know if I need to configure something extra here:

emorales_3-1726515456889.png

Thanks for your help ! 

View Entire Topic
bill_froelich
Product and Topic Expert
Product and Topic Expert

MDK will automatically pass the selected object as the default object binding to the next page.

In this case, from your screen shots it looks like the Card Collection is bound to the NOTICIA entity set.  This means that the selected record from the NOTICIA entity set will be the default object for the detail page.  The binding in the KeyValue should then just need to be the property name under NOTICIA.

In your screen shot it looks like you are binding to {NOTICIA/TITULO} and {NOTICIA/CUERPO}.  Given that the default object is a record in NOTICIA.  The binding should then just need to be {TITULO} and {CUERPO}.

Give that a shot and see if it works then.

emorales
Explorer
0 Kudos
Hi Bill, thanks for your help. I'd like to say that was the problem, but it's not. The page still shows empty data.
bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos
Can you share the detail page definition?
emorales
Explorer
0 Kudos

Yes, this is the complete definition:

 

{
	"Controls": [
		{
			"FilterFeedbackBar": {
				"ShowAllFilters": false,
				"_Type": "Control.Type.FilterFeedbackBar"
			},
			"_Type": "Control.Type.SectionedTable",
			"_Name": "SectionedTable0",
			"Sections": [
				{
					"Separators": {
						"TopSectionSeparator": false,
						"BottomSectionSeparator": true,
						"HeaderSeparator": true,
						"FooterSeparator": true,
						"ControlSeparator": true
					},
					"KeyAndValues": [
						{
							"Value": "{TITULO}",
							"DataSubscriptions": [],
							"_Name": "KeyValueItem0",
							"KeyName": "Título",
							"Visible": true
						}
					],
					"MaxItemCount": 1,
					"_Type": "Section.Type.KeyValue",
					"_Name": "SectionKeyValue0",
					"Visible": true,
					"EmptySection": {
						"FooterVisible": false
					},
					"Layout": {
						"NumberOfColumns": 2
					}
				},
				{
					"Separators": {
						"TopSectionSeparator": false,
						"BottomSectionSeparator": true,
						"HeaderSeparator": true,
						"FooterSeparator": true,
						"ControlSeparator": true
					},
					"KeyAndValues": [
						{
							"Value": "{CUERPO}",
							"_Name": "KeyValueItem1",
							"KeyName": "Noticia",
							"Visible": true
						}
					],
					"MaxItemCount": 1,
					"_Type": "Section.Type.KeyValue",
					"_Name": "SectionKeyValue1",
					"Visible": true,
					"EmptySection": {
						"FooterVisible": false
					},
					"Layout": {
						"NumberOfColumns": 2
					}
				},
				{
					"Separators": {
						"TopSectionSeparator": false,
						"BottomSectionSeparator": true,
						"HeaderSeparator": true,
						"FooterSeparator": true,
						"ControlSeparator": true
					},
					"Layout": {
						"LayoutType": "Vertical",
						"HorizontalAlignment": "Leading"
					},
					"_Type": "Section.Type.ButtonTable",
					"_Name": "SectionButtonTable0",
					"Visible": true,
					"EmptySection": {
						"FooterVisible": false
					},
					"Buttons": [
						{
							"Styles": {
								"Button": "MainButton"
							},
							"_Type": "ButtonTable.Type.Button",
							"_Name": "ButtonTableTypeButton0",
							"Title": "No me gusta",
							"Alignment": "Center",
							"ButtonType": "Text",
							"Semantic": "Tint",
							"Image": "sap-icon://heart-2",
							"ImagePosition": "Leading",
							"FullWidth": true,
							"Visible": true,
							"Enabled": true
						}
					]
				}
			]
		}
	],
	"DesignTimeTarget": {
		"Service": "/BTP6S/Services/obfuscated-mdk-btp6s.service",
		"EntitySet": "NOTICIA"
	},
	"_Type": "Page",
	"_Name": "Noticias_Detail",
	"Caption": "Noticia",
	"PrefersLargeCaption": true
}