I have a custom menu written to copy the item language version to another language.
The current behavior is - when I click on the menu it copies the current language version to another language version and don't reload or refresh the item. I have to re-click on the item to reload or refresh it. I want to trigger this by code so I wrote the code as below
var copiedItem = _db.GetItem(item.ID, _targetLanguage); string load = string.Concat("item:load(id=", copiedItem.ID, ",language=", copiedItem.Language, ",version=", copiedItem.Version, ")"); Context.ClientPage.SendMessage(this, load);
But I am getting the error as below -
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Sitecore.Web.UI.Sheer.ClientPage..ctor() at Sitecore.Context.get_ClientPage() at PT.Framework.ItemCopy.Copying.CopyFromLanguage.AddVersionRecursiveCommand.StartProgressBar(Object contextParameters)
What I understood so far is that I cannot refresh the ClientPage from a custom command class. but then there should be some solution, right? if yes, then please help me to resolve this (it's already taken my half a day)
Thank you to all in advance.