更改项目图标后刷新Sitecore [英] Refresh Sitecore after changing icon of Item

查看:107
本文介绍了更改项目图标后刷新Sitecore的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将一个额外的事件处理程序连接到Sitecore onItemSaved操作,以更改Sitecore中项目的图标。图标会更改,但您必须刷新Sitecore内容树才能看到它已更改。是否可以以编程方式确保更改的图标在内容树中立即显示给用户?

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?

我使用过:

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

带有 Editing.BegintEdit()和一个 EventDisabler

当您更改Sitecore中项目的图标时,图标立即可见,这也是我想要看到的。

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.

有什么建议吗?

谢谢!

推荐答案

要从代码中刷新内容树,请使用:

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);

这篇关于更改项目图标后刷新Sitecore的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆