You can use the enqueueMessage
function to display a message in the system output section.
In the code you've provided, you will see the following:
$mainframe->redirect(JRoute::_('index.php?option=com_rsform&view=directory&Itemid='.$itemId_value, false));
Replace it with the following:
$mainframe->redirect(JRoute::_('index.php?option=com_rsform&view=directory&Itemid='.$itemId_value, false), 'successfully deleted', 'success');
For ease of view:
$url = 'index.php?option=com_rsform&view=directory&Itemid='.$itemId_value;
$msg = 'successfully deleted';
$type = 'success';
$mainframe->redirect(JRoute::_($url, false), $msg, $type);
Update:
Sorry, it turns out that passing a message in the redirect function is deprecated. Instead, enqueueMessage
should be used before the redirect, like so:
$url = 'index.php?option=com_rsform&view=directory&Itemid='.$itemId_value;
$msg = 'successfully deleted';
$type = 'success';
$mainframe->enqueueMessage($msg, $type);
$mainframe->redirect(JRoute::_($url, false));