This is a migrated thread and some comments may be shown as answers.

RadMenu Web Service caching

3 Answers 115 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Michael Johnston
Top achievements
Rank 1
Michael Johnston asked on 27 Jun 2008, 09:15 PM
When populating a RadMenu using the WebService feature, is it possible to call the WebService every time the menu is opened? 

Opening the menu for the first time executes the WebService code, however opening the menu after that happens without going to the WebService code (it must be cached somewhere). Is there a way to set the timeout on this cache or are the results essentially static after initally loading?

In our application the contents of the RadMenu need to change dynamically within the same browser session. We're currently playing with using the new WebService feature instead of regular data binding to achieve this functionality - is this outside the the intended functionality?

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 30 Jun 2008, 08:49 AM
Hi Michael,

This is not possible out of the box. Once the item loads its child items from WebService, its expand mode is set to client-side, so the items are cached.
To workaround this I suggest that you subscribe to the OnClientItemClosed event and define its event handler as follows:

function OnClientItemClosedHandler(sender, eventArgs)  
{  
    var item = eventArgs.get_item();  
    sender.trackChanges();  
    //clear the child items  
    item.get_items().clear();  
    //set the expand mode back to WebService  
    item.set_expandMode(Telerik.Web.UI.MenuItemExpandMode.WebService);  
    item._itemsLoaded = false;  
    sender.commitChanges();  

We will do our best so that in the next version of the menu all this (setting the expand mode and the _itemsLoaded variable) will be done automatically when you call the clear() method.

I hope this helps.

All the best,
Veskoni
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
piotre6
Top achievements
Rank 1
answered on 19 Sep 2012, 01:08 PM
Hi I have a problem with given solution.Everything is fine if I click item from first level of menu.
If anything is clicked on levels 2+, next time when menu should appear I got following error:

Unable to get value of the property '_getChildren': object is null or undefined
0
Boyan Dimitrov
Telerik team
answered on 24 Sep 2012, 10:39 AM
Hello,

Considering the fact that last response to this ticket was almost 4 years ago the information here might be not relevant at this moment . I suggest you to open a new ticket and discuss your issue there, so we can avoid any further confusion.
 
Greetings,
Boyan Dimitrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Menu
Asked by
Michael Johnston
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
piotre6
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or