Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8436957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:18:49+00:00 2026-06-10T07:18:49+00:00

I have a simple component following the hello world tutorial for the most part,

  • 0

I have a simple component following the hello world tutorial for the most part, and everything works except i’ve added a publish / unpublish icons to the toolbar and to the list itself (the small green / red circles).

The toolbar icons work and they can change the state no problem, but the small icons do not, here is the code I have:

view.html.php:

 protected function addToolBar() 
  {
    JToolBarHelper::title(JText::_('COM_MADS_MANAGER_OBJECTS'));
    JToolBarHelper::publishList($task = 'objects.publish', $alt = 'Publish');
    JToolBarHelper::unpublishList($task = 'objects.unpublish', $alt = 'Unpublish');
    JToolBarHelper::deleteListX('', 'objects.delete');
    JToolBarHelper::editListX('object.edit');
    JToolBarHelper::addNewX('object.add');
  }

tmpl > body:

<?php
// No direct access to this file
defined('_JEXEC') or die;
?>
<?php foreach($this->items as $i => $item): ?>
  <tr class="row<?php echo $i % 2; ?>">
  <td><?php echo $item->id; ?></td>
  <td><?php echo JHtml::_('grid.id', $i, $item->id); ?></td>
  <td><a href="<?php echo JRoute::_('index.php?option=com_mads&task=object.edit&id=' . $item->id); ?>"><?php echo $item->title; ?></a></td>
  <td><?php echo $item->description; ?></td>  
  <td align="center"><?php $published = JHTML::_('grid.published', $item, $i); echo $published;?></td>
  </tr>
<?php endforeach; ?>

I am using the built in publish / unpublish function and did not create one of my own.

Tables:

<?php
// No direct access to this file
defined('_JEXEC') or die;

jimport('joomla.database.table');

class MAdsTableObjects extends JTable
{
    var $id = null;
    var $title = null;
    var $description = null;
    var $published = 0;


  function __construct(&$db) 
  {
    parent::__construct('#__mads_objects', 'id', $db);
  }
}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T07:18:50+00:00Added an answer on June 10, 2026 at 7:18 am

    I figured it out after A LOT OF FREKIN HEADACHE and wasted time, it should be:

    <?php echo JHtml::_('jgrid.published', $item->published, $i, 'objects.',true); ?>
    

    where objects. is the name of my view / controller / model for the listing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am following the http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-controlled-application/simple-acl-controlled-application.html tutorial and I am at the part where you
I want to create a simple COM component in VC++ 2008. I have created
I'm trying to create a custom component to extend PrimeFaces. I have a simple
So I am trying to run console 64 bit Hello World program. I have
I have a simple composite component with an optional ajax listener implemented with the
I have a simple JSF 2.0 composite component example. <!DOCTYPE html PUBLIC -//W3C//DTD XHTML
I have written a simple upload component in Flash, but I am now having
I have the following spring configuration: <context:component-scan base-package=uk.co.mysite.googlecontactsync.aop/> <bean name=simpleEmailSender class=uk.co.mysite.util.email.simple.SimpleEmailSenderImplementation/> <aop:aspectj-autoproxy/> Then I
I have created custom component for displaying text with either Simple or Password mode,
I have the following (fairly) simple JavaScript snippet that I have wired into Greasemonkey.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.