我想通过两个部分将数据从2个源传递到Searchfield控件,如此处的示例所示。 https://openui5.hana.ondemand.com/#/topic/dfe04650afc046e0802abb1a1a90d2d9
我的代码:
var input = JsonConvert.DeserializeObject<Dictionary<string, string>[]>(@"
[
{
""2"": ""a"",
""3"": ""a""
},
{
""2"": ""f"",
""3"": ""a"",
""4"": ""p""
},
{
""2"": ""n"",
""3"": ""o"",
""4"": ""t""
}
]");
var result = input
.SelectMany(d => d.OrderBy(kvp => kvp.Key).Select(kvp => kvp.Value))
.Select((value, index) => new {index, value})
.ToDictionary(iv => iv.index, iv => iv.value);
var jsonResult = JsonConvert.SerializeObject(result);
此操作失败,并显示以下跟踪信息
<SearchField
id="mySFID"
enableSuggestions="true"
search="onSelectDiseaseTerm"
suggest="onSuggestDiseaseTerm1"
suggestionItems="{
parts : [
{path: 'db2>/SOURCE1/'},
{path: 'db2>/SOURCE2/'}],
type: 'sap.m.SearchField'}" >
<suggestionItems>
<SuggestionItem
text="{db2>DISEASE_TERM}"
key="{db2>DISEASE_TERM}" />
</suggestionItems>
</SearchField>