I was going through this part of the tutorial:
Except I tried using my own names instead of 'helloworld'.

Everything else works fine, even the site-page loads the text from the database. The problem is:

On the backend 'Menu Item' options, where there's supposed to be a list, it's just showing a blank textbox.

enter image description here

The codes I've used are:



        <fieldset name="request">


defined('_JEXEC') or die('Restricted access');


class JFormFieldUlWiz_WMode extends JFormFieldList
    protected function getOptions()
        $db    = JFactory::getDBO();
        $query = $db->getQuery(true);
        $db->setQuery((string) $query);
        $messages = $db->loadObjectList();
        $options  = array();

        if ($messages)
            foreach ($messages as $message)
                $options[] = JHtml::_('select.option', $message->id, $message->wmode);

        $options = array_merge(parent::getOptions(), $options);

        return $options;

And the Database description:

DROP TABLE IF EXISTS `#__omitted_ulwiz_wmode`;

CREATE TABLE `#__omitted_ulwiz_wmode` (
    `id`        INT(11)     NOT NULL AUTO_INCREMENT,
    `wmode`     VARCHAR(25) NOT NULL,
    `published` tinyint(4)  NOT NULL DEFAULT '1',
    PRIMARY KEY (`id`)


INSERT INTO `#__omitted_ulwiz_wmode` (`wmode`) VALUES

How do I fix this? I've been at it for hours and am unable to move over to the next part of the tutorial hence.

1 Answer 1


The problem is that it is not able to get the field. I see filename you have defined as ulwiz_wmode.php and in class name you are using this JFormFieldUlWiz_WMode. Make sure the naming convention is very proper and should be same as class name and filename. It should be JFormFieldUlwiz_wmode.

defined('_JEXEC') or die('Restricted access');


class JFormFieldUlwiz_wmode extends JFormFieldList
   protected $type = 'ulwiz_wmode'; //also add this line

   protected function getOptions()
        //your code

You are creating your own custom field. For more details on custom fields refer this documentation:


  • Apologies. $type='ulwiz_wmode' is there in the actual code, forgot to copy it to here. I thought the $type automatically hooked the class to the right field type. So, I read up on the documentation in the link and wow, I didn't know the naming conventions were this strict. Also googling 'Camel Casing' gave a few hits where devs were asked to choose either CamelCasing or under_score naming conventions.
    – Glitch
    Commented Aug 31, 2017 at 14:09
  • 2
    Finally tried out the coding: Ulwiz_wmode didn't work. But UlwizWmode and even UlWizWMode worked. I guess underscores aren't allowed here. I'm going to mark this as Answer since naming was indeed the issue. Thanks for the help! Funny though, I used OmittedTableUlWiz_WMode as the JTable class and that works, somehow.
    – Glitch
    Commented Aug 31, 2017 at 14:09
  • 1
    I am glad it helped. :)
    – Liz.
    Commented Aug 31, 2017 at 15:51

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.