Lars Nielsen at Sitecore just made my day (and, seeing that it's friday today it couldn't have been done much better), so, i reckon i'll have to have a beer later in his honor.
My plans for a few days of r&r (some call it vacation, but i think vacation is when you have to much time on your hands to know what to do with) are safe and in no apparent danger.
Quick thing about portlets: if you've ever added a contextmenu to a listview in the xaml itself and then used it, you'll notice it magically vanishes after the list is refreshed. well, there's a work-around for that as well.
Assuming the code looks something like the following:
protected Listview BudgetList;
// more nice stuff that you're using..
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!Sitecore.Context.ClientPage.IsEvent)
{
// some code here to load it all if you have any..
}
}
All you'll actually really have to do here, for now (i'm sure it'll be fixed and even improved by the rate they're developing) is to add one line to the OnLoad() event:
protected Listview BudgetList;
// more nice stuff that you're using..
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!Sitecore.Context.ClientPage.IsEvent)
{
BudgetList.ContextMenu = "show:BudgetContextMenu";
// some code here to load it all if you have any..
}
}
(sorry for the crappy layout of the text, don't really have the time to edit it properly).
No comments:
Post a Comment