I am trying to dynamically add actionitems, I can add the item and it works when I do this:
HostActionItem := ActionManager.ActionBars[0].Items[0].Items[2];
NewItem := HostAction.Items.Add;
NewItem.Action := MyActionToPerform;
NewItem.Caption := Description;
NewItem.ImageIndex := 1;
NewItem.Tag := 13;
However, when the action Execute method fires I attempt to get the ActionComponent from the Sender object like this:
if (Sender is TAction) then
tag := (Sender As TAction).ActionComponent.Tag;
But the ActionComponent is always nil. Why is the ActionComponent not being initialised?