title: JOOMLA: Call to a member function getFieldset() on a non-object
body: <p>I'm beginner in PHP and developing my own component for Joomla. I've replaced all the classes in HelloWorld example but yet I haven't change the names of views. If I try to open the specific message/record in the backend I get the error:</p>
  
  <p><strong>Fatal error: Call to a member function getFieldset() on a non-object in administrator/components/com_mycom/views/helloworld/tmpl/edit.php on line 12</strong></p>
  
  <p>Line 12: <code>&lt;?php foreach ($this-&gt;form-&gt;getFieldset('details') as $field) : ?&gt;</code></p>
  
  <p>The code of my <strong>administrator/components/com_mycom/models/fields/mycom.php:</strong></p>
  
  <pre><code>&lt;?php
  defined('_JEXEC') or die;
  jimport('joomla.form.helper');
  JFormHelper::loadFieldClass('list');
  
  class JFormFieldHelloWorld extends JFormFieldList
  {
      protected $type = 'Mycom';
      protected function getOptions()
      {
          $db = JFactory::getDBO();
          $query = $db-&gt;getQuery(true);
          $query-&gt;select('h.id, h.header, h.parent')
              -&gt;from('#__pages as h')
              -&gt;select('c.title as category')
              -&gt;leftJoin('#__categories AS c ON c.id = h.parent');
          $db-&gt;setQuery($query);
          $messages = $db-&gt;loadObjectList();
          $options = array();
          if ($messages)
          {
              foreach ($messages as $message)
              {
                  $options[] = JHtml::_('select.option', $message-&gt;id,
                      $message-&gt;header . ($message-&gt;parent ? ' (' . $message-&gt;category . ')' : '')
                  );
              }
          }
          $options = array_merge(parent::getOptions(), $options);
          return $options;
      }
  }
  </code></pre>
  
  <p>Joomla 3.4</p>