I have an implementation that uses Sheer UI and I'm creating a combobox on a page which on changes will perform a certain action. On the implementation of the Change method should it be registered as a command? Or is the method declaration on the MyClass is not correct?
My Xml combobox looks like this:
<Combobox ID="Target" Width="100%" Change="OnSortChanged">
<ListItem Value="Alphabetical" Header="Alphabetical"/>
<ListItem Value="Created" Header="Date Created"/>
<ListItem Value="Updated" Header="Date Modified"/>
</Combobox>
The code beside has a method declared as:
protected void OnSortChanged(Combobox sender, EventArgs args)
{
//Do stuff
}
When I change the dropdown value on the interface I get the exception:
Exception: System.Exception Message: Method "OnSortChanged" not found in MyNamespace.Web.XmlControls.MyClass. (method: Sitecore.Web.UI.Sheer.ClientPage.Dispatch(String command)). Source: Sitecore.Web.UI.Sheer.ClientPage.Dispatch(String command) at Sitecore.Diagnostics.Error.Raise(String error, String method) at Sitecore.Shell.Framework.Commands.CommandManager.GetMethodCommand(String command) at Sitecore.Web.UI.Sheer.ClientPage.Dispatch(String command) at Sitecore.Web.UI.Sheer.ClientPage.RaiseEvent() at Sitecore.Web.UI.Sheer.ClientPage.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
OnSortChanged
public?