cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Issue with Search Functionality in Dynamic Object Card Collection

Sharon_Shaji
Explorer
0 Likes
1,057

Hi everyone,

I’m experiencing an issue with the search functionality in my dynamic object card collection. Despite having the search enabled set to true, the search feature doesn’t seem to be working. Whenever I try to search for something, it doesn’t return any results.

Has anyone else encountered this problem? Any suggestions or solutions would be greatly appreciated!

Thanks in advance!

Accepted Solutions (0)

Answers (2)

Answers (2)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Likes

There is not automatic search support for non-OData targets.  Looking at your page def you are getting your data from ClientData.  You can still implement search but will need to use a rule for your Target and do the filtering within the rule to return the filtered search results to be displayed.

The rule can access the searchstring and based on if that is populated do the necessary filtering of your ClientData list.

Sharon_Shaji
Explorer
0 Likes
@ bill_froelich, thank you for your help , then what should i use so that the search feature is functional.
bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Likes

You will need write a rule for your target that handles the filtering of the #Application/#ClientData/ManualSampleDetails array based on the searchString to return the subset of data matching your desired search restrictions and sort if needed.

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Likes

I ran a test using the Android Emulator running a MDK 24.7.5 client and the Sample Service V4 in Mobile Services.  I set the target for my Object Card Collection to bind to the Products entity set (offline mode) and enabled search on the collection.  Search is working as expected for me in this scenario.  Here is the Object Card section definition I am using.  

{
	"_Type": "Section.Type.ObjectCardCollection",
	"Target": {
		"Service": "/SCN_00041/Services/SampleServiceV4.service",
		"EntitySet": "Products"
	},
	"_Name": "SectionObjectCardCollection0",
	"Header": {
		"_Type": "SectionCommon.Type.Header",
		"_Name": "SectionCommonTypeHeader0",
		"AccessoryType": "None",
		"UseTopPadding": true,
		"Caption": "Object Card Search Test"
	},
	"Visible": true,
	"EmptySection": {
		"FooterVisible": false
	},
	"Separators": {
		"TopSectionSeparator": false,
		"BottomSectionSeparator": true,
		"HeaderSeparator": true,
		"FooterSeparator": true,
		"ControlSeparator": true
	},
	"DataPaging": {
		"ShowLoadingIndicator": false,
		"PageSize": 50
	},
	"Card": {
		"Visible": true,
		"Title": "{Name}",
		"Subhead": "{Category}",
		"Footnote": "{ProductID}",
		"DetailImage": "/SCN_00041/Services/SampleServiceV4.service/{@odata.readLink}/Picture",
		"DetailImageIsCircular": false,
		"Description": "{ShortDescription}",
		"PrimaryAction": {
			"OnPress": "/SCN_00041/Actions/SampleServiceV4/Products/NavToProducts_Detail.action",
			"Title": "View",
			"Visible": true
		},
		"SecondaryAction": {
			"Title": "Secondary",
			"Visible": false
		},
		"_Type": "Control.Type.ObjectCard"
	},
	"Search": {
		"Enabled": true,
		"Placeholder": "Product Search",
		"BarcodeScanner": true,
		"Delay": 500,
		"MinimumCharacterThreshold": 3
	},
	"Layout": {
		"LayoutType": "HorizontalScroll"
	}
}

If it is not working for you perhaps you can share your section metadata.  Also, are you working with an online or offline odata service?

Sharon_Shaji
Explorer
0 Likes
@ bill_froelich, i am using REST service API, it is a SQL API, sharing the code,{ "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 }, "_Type": "Section.Type.ObjectCardCollection", "Target": "{#Application/#ClientData/ManualSampleDetails}", "_Name": "SectionObjectCardCollection01", "Visible": true, "EmptySection": { "FooterVisible": false, "Style": "objectCardBG" }, "DataPaging": { "ShowLoadingIndicator": false, "PageSize": 50 }, "Card": { "Visible": true, "Title": "{SampleName} {Space} {Status}", "Subhead": " Date Received From \n {Date} {ReceivedFrom}", "DetailImageIsCircular": false, "OnPress": "/QA_DigiLab/Actions/NavToTestCBOSample.action", "Styles": { "Title": "container", "BackgroundColor": "objectCardBG" }, "_Type": "Control.Type.ObjectCard" }, "Search": { "Enabled": true }, "Layout": { "LayoutType": "Vertical" } } ] } ], "_Type": "Page", "_Name": "ManualSampleDetails", "Caption": "CBO Sample", "PrefersLargeCaption": true, "FioriToolbar": { "_Type": "Control.Type.FioriToolbar", "_Name": "FioriToolbar0", "Items": [ { "_Type": "FioriToolbarItem.Type.Button", "_Name": "ToolbarItem0", "Visible": true, "Title": "Add", "Styles": { "Button": "btnPink" }, "OnPress": "/QA_DigiLab/Actions/Nav_to_Add_New_CBO_Sample.action", "Image": "sap-icon://add", "Enabled": true, "ButtonType": "Primary", "Semantic": "Normal", "ImagePosition": "Trailing" } ] } }