/**
  * If the TableModel holds information about filters that where applied, we pass them into the form element
  *
  * @param ElementInterface $element
  * @param string $fieldName
  * @param TableModel $tableModel
  * @return Element
  */
 public static function setElementCurrentValue(ElementInterface $element, $fieldName, TableModel $tableModel)
 {
     $filter = $tableModel->getTableFilter($fieldName);
     if ($filter && !empty($filter->getSelectedValue())) {
         $element->setValue($filter->getSelectedValue());
     }
     return $element;
 }