We are developing a custom component in joomla 3.X. We have a list view and added some custom filters on the top of the list. Our problem is, that there will be too many results if no filter applied. We are wondering how we could set a default value for the filter when the pages loads for the first time.
We have tried it in the constructor of the model or in the populatestate method, but without success.
$app = JFactory::getAplication();
$from_date = $app ->getUserStateFromRequest();
$date = date('Y-m-d H:i:s');
if($from_date === null)
{
$from_date = $date;
}
Unfortunately it did not work and could not find a way of setting it. Thanks!