Skip to main content
1-Visitor
April 28, 2020
Solved

How to get details of selected menu from any service.

  • April 28, 2020
  • 1 reply
  • 1772 views

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. 

Best answer by CarlesColl

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.

1 reply

1-Visitor
April 28, 2020

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.

menayat1-VisitorAuthor
1-Visitor
April 29, 2020

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!

1-Visitor
April 29, 2020

Setting isDefault to true should work.