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
505

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
panushjain
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @emorales 

Remove _Type": "ButtonTable.Type.Button" from the page definition and give it a try. I am able to build the page, sharing screenshot below.

Screenshot_1726545574.png

I am sharing the updated version of the page file below for your reference.

 

{
	"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"
							},
							"_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
}

 

Thank you.

emorales
Explorer
0 Kudos

Hi ! Thanks for your help. Sorry, but that line is not duplicated. You only deleted it and give and error with that correction, let me show you an scheenshoot from my VS:

emorales_0-1726575544687.png

 

panushjain
Product and Topic Expert
Product and Topic Expert
0 Kudos
Omit line#89 from your page definition and give it a try or use the page definition shared by me earlier.
emorales
Explorer
0 Kudos
Sorry, but it doesn't work. I have also created the page again without any buttons and I have the same problem. I suspect it is a bug.