I'm developing a Joomla component where I have a treeview in the sidebar with the content of a database table. When clicking a node of this sidebar I want to show the children nodes in the main part of the window as a list (as the windows explorer does). For what I have been reading the best way to do this is an ajax request like explained here.

I link to the url in each node: href="index.php?option=com_nautilus&task=datalist&format=raw"

In controller.php I add:


public function datalist()
    $this->input->set('view', 'Datalist');


I create /views/datalist with the file view.raw.php


    defined('_JEXEC') or die;


    class SimilarViewDatalist extends JViewLegacy
        function display($tpl = null)

and /views/datalist/tmpl with the file default.php



           echo "Hello World from /views/datalist/tmpl/default.php";

But I get:

An error has occurred. 500 View class not found [class, file]: nautilusViewDatalist, C:\xampp\apps\joomla\htdocs\administrator\components\com_nautilus\views\dataList\view.raw.php

2 Answers 2


Your component's name is com_nautilus. With Joomla MVC your controller is looking for a class called "nautilusViewDatalist" in the file view.raw.php but you named your class "SimilarViewDatalist". That's were the error 500 comes from.


How to Implement Ajax in Joomla Component

Create Controller File Where you will send ajax request from javascript to PHP


defined('_JEXEC') or die('Access Deny');
class OpenChatController extends JController

    function saveChatViaAjax()
        //Implement Your Logic i am giving some sample response
        echo json_encode($res);


From View Page You will send Ajax request using Jquery(also you can use native javascript xhr)

        //Sending Ajax Request to saveChatViaAjax method on Controller OpenChatController
        var param={};
        param.msg='Please save this mesage';


For more info You can download https://f10df5600a7c9a74bb22e6b8df498775b8acd045.googledrive.com/host/0Bwk7CPC93wgSVjZUR2c2enNnZ3M/Source%20Codes/Joomla%20OpenChat%20V1.0.0%20Source%20Code/com_openchat-v1.0.0.zip

You can watch whole video series https://www.youtube.com/playlist?list=PL7kkxuLFYIDOrj395REpd0golrCV7XLcY

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.