1 Reply Latest reply on Feb 1, 2016 12:14 PM by aanjan RSS
    sbajpai Newbie

    Different Menu for different cases



    I was working on this case where I have to add a menu to my home page mashup. Now based on different rules I have to show different menu on the same page. So I wrote the service that returns menu name based on which I wanted to show the menu. But I could find no way to bind the resulting menuname to the menu widget. After various tries I finally used an approach where I replaced Menu widget with Contained Mashup widget and the service now returns the mashup name instead of the menu name. Then I created different mashups with different menu which now loads at the location where I needed the menu. The approach did solve the problem but I don't find this an ideal way of doing it. Is there any other way of doing it which is more ideal than what I have used?



      • Re: Different Menu for different cases
        aanjan Heavyweight Champ

        Stuti, try this - make the Menu widget as Data-driven (set on the bottom left pane). Hit the 'add data' button in your Mashup, select Dynamic and choose a Menu. Search and add the 'GetMenuItems' service, and bid the 'all data' of this service to the Menu widget. So, only when you give an entity name, the menu will be displayed.


        As a quick test, add a text box widget, bind that to the 'EntityName' of your GetMenuItems service. Bind the changed event of the text box to the GetMenuItems service. Now view your Mashup. If you type in a menu name in the text box and hit return, that specific menu should be displayed.