J1.5 talk

Using the editor in a component

From Joomla! Documentation

Revision as of 07:42, 13 April 2009 by Hensie43 (Talk | contribs)

I used a test site and implemented the editor in the frontend. The edit and display functions worked fine however the Save and Cancel do not execute anything. The Save and Cancel buttons that have been added to the form call a javascript function submitbutton. The submitbutton is executed however the documentation states that the editor's save method will trigger the save function in the controller which in turn calls the model's store method. This is not actually true. I am new to Joomla development so I thought maybe I typed it in wrong so I downloaded the completed example and it does not work either. The editor's save method does not trigger the controller which I believe is necessary. SO I think in order to make it work you need to trigger the controller directly from the button and bypass the javascript -submitbutton. I haven't tried it yet so if there any other suggestions. That would be great.

The tutorial is not complete

Well what is happening is the following. The person who wrote the tutorial forgot one thing.

In order to use the proposed javascripts the library file /includes/js/joomla.javascript.js had to be included. This is standard in de Joomla backend but not in many frontend templates.

You have to manually add the following. This can for example be done view.html.php $document =& JFactory::getDocument(); $document->addScript('includes/js/joomla.javascript.js');

I have modified the tutorial but I at this point I don't know how to replace the included download files.