When saving a Sitecore item I am trying to display a popup to interact with the user. Depending on data that they have changed I may display a series of 1 or 2 popups asking them if they want to continue. I have figured out how to tap in to the OnItemSaving pipeline. That is simple. What I can't figure out is how to display a popup and react to the input from the user. Right now I am thinking that I should be using the Sitecore.Context.ClientPage.ClientResponse object somehow. Here is some code that shows what I am trying to do:
public class MyCustomEventProcessor
{
public void OnItemSaving(object sender, EventArgs args)
{
if([field criteria goes here])
{
Sitecore.Context.ClientPage.ClientResponse.YesNoCancel("Are you sure you want to continue?", "500", "200");
[Based on results from the YesNoCancel then potentially cancel the Item Save or show them another dialog]
}
}
}
Should I be using a different method? I see that there is also ShowModalDialog and ShowPopUp and ShowQuestion, etc. I can't seem to find any documentation on these. Also I am not even sure if this is the correct way to do something like this.
The process goes something like this (I should note that I've never tried this from the item:saving event, however, I believe it should work):
item:saving
event, invoke a dialog processor in the client pipeline, and pass it a set of arguments.Here is an example that demonstrates the steps above: