How to delete selected positions in generated admin view.

I've added to admin view generated by CRUD shell command a button which allows me to delete selected entries from DB. I've extended also admin view by following checkbox:

<?php echo CHtml::checkBox('selection',false); ?>

Delete button is defined following:

  [<?php echo CHtml::linkButton('modify selected',array(


    'submit'=>'action/deleteMarked',


    'confirm'=>'Are you sure to delete selected news?'));?>]

Now comes question. How can I read selected value after pressing button in delteMarked action? I think I've to pass somehow id value to checkbox, this is first. Second is, how to properly define delete button to be able to read all selected checkbox via $_POST['selection']?

Should I clarify my question with some additional informations?

To obtain the current selection, you can store the id using the 'params' option in linkButton().  Check the API doc for CHtml::clientChange().

To obtain all selected checkboxes, you will need some js which store the selections in some hidden field.