I am creating a joomla component and that i can't take action towards the following. During my front-end I am while using joomlas build at school JToolbar to deal with occasions on click like edit, remove so one.

            <form action="<?php echo JRoute::_('index.php');?>" method="post"
                name="termForm" id="adminForm">

                <table class="stripeMe">



<?php if ($user->authorize('com_glossary', 'edit', 'glossary', 'all')): ?><th>Published</th> <?php endif; ?>    


              <?php foreach($this->items as $i => $item): ?>



                <span class="title"><?php echo $item->tterm; ?></span>

                    <?php if ($user->authorize('com_glossary', 'edit', 'bearbeiten', 'all')):?> 

                       <?php echo $this->getEdit(); ?><?php endif; ?>


               <td><?php echo $item->tdefinition; ?></td>
                 <?php if ($user->authorize('com_glossary', 'edit', 'bearbeiten', 'all')): ?>
               <td><?php echo $this->getPublished(); ?></td> <?php endif; ?>    

               <?php endforeach; ?>


        <input type="hidden" name="task" value="" /> <input type="hidden"
                        name="id" value="" onclick="submitbutton(<?php echo count( $item->id ); ?>);" /> <input type="hidden"
                        name="option" value="com_glossary" /> <input type="hidden"
                        name="controller" value="bearbeiten" />

        <?php echo JHtml::_('form.token'); ?>

I must pass to id from the selected row towards the sub-controller on button event and that i don't really understand how to get it done

Here you've some helpful advice on using JToolbar around the frontend http://docs.joomla.org/How_to_use_the_JToolBar_class_in_the_frontend

I've tried it once previously, and from things i remember Used to do some methods to be able to have great results.

1.) First of all take away the "id" input and add the next one in the finish of the form:

<input type="hidden" name="boxchecked" value="0" />

2.) Next make certain Mootools is connected to the source

3.) Finally: There, in which you began your foreach loop, after "tr" tag add another table column:

 <td><?php echo JHTML::_('grid.id', $i, $item->id ); ?></td>

Be sure to produce a column heading in thead with this column.

These steps can create a checkbox within the first cell of each and every row making the shape in a position to send selected field's id with request.

edit: tbody tag is within wrong place, it's said to be after thead tag. Also there's no utilization of affixing occasions to hidden input because they will not be triggered