Fatal error: Class 'JElement' not found in self defined parameters.

729 views
Skip to first unread message

pherfinion

unread,
May 22, 2012, 3:31:24 PM5/22/12
to Joomla! General Development
I Try to add a self defined parameter. Here the beginning of the code

defined('JPATH_BASE') or die('RESTRICTED');
class JElementMyList extends JElement

but I always get Fatal error: Class 'JElement' not found. Then i try
to import

jimport("joomla.html.parameter.element");

that works so far, but i get only a text field??

pherfinion

unread,
May 23, 2012, 11:08:29 AM5/23/12
to Joomla! General Development
now I'll take the sql.php from original joomla and modify only two
Lines
class JElementMYSQL extends JElement
{
/**
* Element name
*
* @var string
*/
protected $_name = 'MYSQL';

And rename the file to mysql.php. But i get a textfield??

elin

unread,
May 23, 2012, 1:48:54 PM5/23/12
to joomla-de...@googlegroups.com
Is there a reason you are not using JFormField? Parameter is deprecated and your code won't work in future releases. 

What is the field supposed to be doing? 

Elin

pherfinion

unread,
May 24, 2012, 9:39:07 AM5/24/12
to joomla-de...@googlegroups.com
I would like to create a multiple select field for the config.xml. Here, all components are displayed, so that it is possible to select multiple components.

elin

unread,
May 24, 2012, 10:21:36 AM5/24/12
to joomla-de...@googlegroups.com

Are you saying that you trying to use an sql type field? 

Elin

pherfinion

unread,
May 24, 2012, 12:53:54 PM5/24/12
to joomla-de...@googlegroups.com
Yes, but in a standard sql field I can't select multiple values.

elin

unread,
May 25, 2012, 4:22:19 PM5/25/12
to joomla-de...@googlegroups.com

elin

unread,
May 25, 2012, 4:23:21 PM5/25/12
to joomla-de...@googlegroups.com
Try Multiple=multiple
Reply all
Reply to author
Forward
0 new messages