Send Variable To Cjuidialog

i`ve got view with link that starts modal window using CJuiDialog:

here`s options for link:


'htmlOptions' => array('onclick' => '$("#mydialog").dialog("open"); return false;')

down in the code i`ve got widget:


$this->beginWidget('zii.widgets.jui.CJuiDialog', array(

                    'id' => 'mydialog',

... 

how can i pass some variable to this widget?

i want something like:


'htmlOptions' => array('onclick' => '$("#mydialog").dialog("open", id=' . $someId . '); return false;')

and how can i get this variable in my CJuiDialog widget?