0

I'm trying to render the joomla.searchtools in the front end of a custom component.

I extended JModelList for my model, and I can see the list in the front end. Pagination works well.

But when in my template I add:

 echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this) ); 

I get an error message like this:

0 Call to a member function getGroup() on null

If I change the code above with:

<div class="btn-wrapper input-append"> <input type="text" name="filter[search]" id="filter_search" value="" class="js-stools-search-string" placeholder="Search"> <button type="submit" class="btn hasTooltip" title="" aria-label="Search" data-original-title="Search"> <span class="icon-search" aria-hidden="true"></span> </button> </div> 

The search filter shows and works well.

What have I forgotten?

1 Answer 1

3

I had forgotten two lines in the view:

$this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); 

If someone is interested, here you can find a component example (com_buscador_site) that uses Joomla searchtools in Front End.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.