diff --git a/src/ActionButton.php b/src/ActionButton.php index 685535e..09b099f 100644 --- a/src/ActionButton.php +++ b/src/ActionButton.php @@ -21,8 +21,15 @@ class ActionButton extends Field */ public function action($action, $resourceId): ActionButton { + + $actionInst = \is_string($action) ? new $action() : $action; + + $actionInst->withMeta([ + 'resourceId' => $resourceId + ]); + return $this->withMeta([ - 'action' => \is_string($action) ? new $action() : $action, + 'action' => $actionInst, 'resourceId' => $resourceId, ]); }