开发者

Refresh Sitecore after changing icon of Item

I hooked up an extra eventhandler to the Sitecore onItemSaved actions to change the icon of an item in Sitecore. The icon gets changed, but you have to refresh the Sitecore content tree to see that it has changed. Is it possible to programatically make sure the changed icon gets visible to the user instantly in the content tree?

I used:

item.Field["__icon"].Value = "someicon.pgn"

with a Editing.BegintEdit() and a EventDisabler around it.

When you change the Icon of an item in Sitecore itself, the icon gets visible instantly, this is what I would like to see aswell.

Any suggest开发者_StackOverflowions?

Thanks!


To refresh the content tree from the code use:

//TODO: set to the appropriate item 
String refresh = String.Format("item:refreshchildren(id={0})", currentItem.Parent.ID);
Sitecore.Context.ClientPage.SendMessage(this, refresh);


Remove the EventDisabler, that's likely the issue... It also disables client events...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜