Skip to main content
Apr 28, 2020 6:18 AM UTC
Solved

How to get details of selected menu from any service.

Hi,

 

Suppose I have the menu in my master. The menu is like electronics, groceries, and vegetables in horizontal. 

Now the question is simple. How can I get the detail of the selected menu?


If I select groceries then I want to know the details of the grocery menu like 


menu .linkDestination = "MainMash";
menu .parentMenuId = "TotalCareMenu";
menu .menuId = "TotalCareMenu_0";
menu .isDefault = "true";
menu .imageURL = "";
menu .linkTarget = "Self";
menu .description = "";
menu .linkType = "Mashup";
menu .title = "[[MAP]]";

Thank you. 

Apr 28, 2020 6:46 AM UTC

Historically menu doesn't updates Service Selected Row 😞 

 

There's a nasty trick: Add a hidden List Widget and bind the menu content to it also, set (ValueField=linkDestination,DisplayField=title - or whatever-), then bind Menu's Mashup property to List "SelectedText", and voila you will have the Selected Row on the service result selected and you will be able to use selected Row(s) content.

4 replies

Apr 28, 2020 6:46 AM UTC

Historically menu doesn't updates Service Selected Row 😞 

 

There's a nasty trick: Add a hidden List Widget and bind the menu content to it also, set (ValueField=linkDestination,DisplayField=title - or whatever-), then bind Menu's Mashup property to List "SelectedText", and voila you will have the Selected Row on the service result selected and you will be able to use selected Row(s) content.

menayatAuthor
Apr 29, 2020 7:27 AM UTC

Hi, Thank you for your interest in helping me.

Now I had completed my requirement but now I need to know, how to get a menu by default selected in a dynamic menu.

My codes are


var row = new Object();
row.linkDestination = mainMash;
row.parentMenuId = "Menu";
row.menuId = "Menu_0";
row.isDefault = true;
row.imageURL = "";
row.linkTarget = "Self";
row.description = "";
row.linkType = "Mashup";
row.title = "MAP";
result.AddRow(row);

 

Could you please help me with that. Thankyou!

Apr 29, 2020 7:49 AM UTC

Setting isDefault to true should work.