v1.0.x question regarding administrator component toolbars

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
richardhall
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Oct 10, 2005 2:31 pm

v1.0.x question regarding administrator component toolbars

Post by richardhall » Wed Jan 30, 2008 6:52 pm

Hi guys,

I'm currently developing a new administrator back-end component for Joomla, and I'm having difficulty getting the toolbar buttons to do what I need. I'll describe in brief the scenario, hopefully it'll make sense.

When you go to the component's 'home page' as it were by selecting it from the menu, a list of items/records is displayed (in similar fashion to static content manager), and then after selecting to edit one of those items it disables the main menu ok and takes you to a tabset of forms (a little like the joomla global configuration), and in this section the buttons to Save, Apply, Delete, Cancel etc all work fine. However- I also need to be able to add, edit and delete sub-items from buttons on the same toolbar which take you to other form screens, still while the main menu is disabled- and its these extra toolbar buttons that don't seem to do anything at all when clicked.

Code: Select all

in toolbar.componentname.html.php:
function _InviteEdit() {
  mosMenuBar::startTable();
  // these ones not working:
  mosMenuBar::deleteList( '', 'guest_delete', 'Remove Guest' );
  mosMenuBar::spacer();
  mosMenuBar::addNewX( 'guest_edit', 'edit.png', 'edit_f2.png', 'Edit Guest', true );
  mosMenuBar::spacer();
  mosMenuBar::divider();
  mosMenuBar::spacer();
  // these ones working absolutely fine:
  mosMenuBar::apply( 'invite_applyedit' );
  mosMenuBar::spacer();
  mosMenuBar::custom( 'invite_saveedit', 'save.png', 'save_f2.png', 'Save', false );
  mosMenuBar::spacer();
  mosMenuBar::cancel( 'invite_canceledit' );
  mosMenuBar::spacer();
  mosMenuBar::help( 'screen.componentname.invite_edit' );
  mosMenuBar::endTable();
}


I've got all the functions in my main component php files etc that all tie up etc but it doesn't even try to leave the page and redirect anywhere when you click on these buttons. How do I make them do stuff? Have I got to write my own javascript to with them for some reason? Why do some work and others not? Any ideas? Really appreciate your help- thanks.

richardhall
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Oct 10, 2005 2:31 pm

Re: v1.0.x question regarding administrator component toolbars

Post by richardhall » Thu Jan 31, 2008 3:34 pm

Don't worry, figured it out after seeing an example elsewhere on the Internet. This is all it needed:

Code: Select all

mosMenuBar::deleteList( 'Remove Guest', 'guest_delete', 'Remove Guest' );
mosMenuBar::spacer();
mosMenuBar::editList( 'guest_edit', 'Edit Guest' );
mosMenuBar::spacer();
mosMenuBar::addNew( 'guest_new', 'New Guest' );


Post Reply