Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Introduction

The Panel actions file contains the receiving ends for all the panel events and interactions, e.g. an item update action, an item delete action, etc.

Each one of these actions is implemented as a method inside the panel actions file. Such methods must be called “execute” + “action name”, e.g. “executeAddRow()”.

Action methods should accept the event data argument, containing input from the UI (e.g. attributes, item id, etc.).

Code example

class BasicappPanelActions extends \Innomatic\Desktop\Panel\PanelActions {
    public function __construct(\Innomatic\Desktop\Panel\PanelController $controller) {
        parent::__construct($controller);
    }
    public function beginHelper() {}
    public function endHelper() {}
 
  public function executeDeleteItem($eventData) {
    $this->dataAccess->execute(‘DELETE FROM my_items WHERE ID=‘.$eventData[‘id’]);
  }
}

Helpers

The panel view actions also supports a begin and end helper that are called just before and after a view is executed.

public function beginHelper() {
    $this->localeCatalog = new \Innomatic\Locale\LocaleCatalog(
        'example-basic-app::panel',
        $this->container->getCurrentUser()->getLanguage()
    );
}
 
public function endHelper() {
}
  • No labels