We're have a custo Business Foundation entity type, and trying to add functionality to the Commerce back-end to allow users to add/edit/delete list items.
We've implemented the list view which is is working fine - and now trying to add a custom handler to delete items. I've implemented the following delete handler:
public class ExcludedPostcodeDeleteHandler : EcfListViewSelectionHandlerBase
protected override void ProcessSelectedItems(string items)
for (int index = 0; index < items.Length; ++index)
string keyIdStringItems = EcfListView.GetPrimaryKeyIdStringItems(items[index]);
if (keyIdStringItems != null && keyIdStringItems.Any())
if (int.TryParse(keyIdStringItems.First(), out id))
With the command defined in the xml:
And the command mapped in the following column definition:
However the ID of the selected item is not making it through to the command handler - I get a single item in the array containing an empty string.
Any idea why that might be?
Found an answer for this- I needed to add this to the databinding code:
this.MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("ExcludedPostCodeId");
Now it correctly extracts the command argument value.
Web controls, postback, XML files... let's party like it's 1999