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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Different Menu for different cases

sbajpai
1-Visitor

Different Menu for different cases

Greetings,

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?

Thanks

1 REPLY 1
Aanjan
12-Amethyst
(To:sbajpai)

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.

Announcements


Top Tags