What you need is more or less this:
$base_selection=array();
$contact = CRM_ContactCommon::get_contacts(array(':Fav'=>1));
foreach ($contact as $c) $base_selection[$c['id']] = MyModuleCommon::format_method($c);
$form = $this->init_module('Libs/QuickForm', null, 'RBpicker_test');
$form->addElement('multiselect', 'element_name', 'Contacts', $base_selection);
$form->addElement('submit', 'submit', 'Submit');
$form->display();
if ($form->validate()) print_r($form->exportValues());
$rb1 = $this->init_module('Utils/RecordBrowser/RecordPicker');
$crits = array(); // base criteria for records in leightbox - user can overcome this
$cols = array(); // columns to display/show specifically in the leightbox
$this->display_module($rb1, array('contact' ,'element_name',array('MyModuleCommon','format_method'), $crits, $cols)); // arguments are - recordSet, name of QF element, format callback, criteria, columns
print($rb1->create_open_link('Click here!'));
...
public static function format_method($record) {
return $record['last_name'].' '.$record['first_name'];
}
However, this will get you to the stage where you can manipulate multiselect element with recordpicker. If that leightbox is what you want, I can help you further by pointing what modification RecordBrowser needs to make it work for select element.
Kind regards,
Arek