Cjuidialog Open Updating Question

On a CJuiDialog, I have seen many examples of data being passed to the dialog via the jQuery data function such as I do here:

echo CHtml::button(‘Edit Category’, array(‘onclick’=>’{$("#dialogModifyCategory").data(“category”,$("#id_category").val)).dialog"open");}’,‘class’=>‘assetControl3’));

The CJuiDialog Widget, however, only seems to access the dialog elements when first loaded, and not when the dialog is opened. The alert is not fired on dialog open. Is there some trick into making the widget reload the dialog on an open also??

$url = Yii::app()->createUrl('asset/modifycategory');


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


    'id'=>'dialogModifyCategory',


    'options'=>array(


        'title'=>'Modify Category',


        'autoOpen'=>false,


        'modal'=>true,


        'width'=>300,


        'height'=>200,


        'buttons'=>array('Submit'=>'js: function() {


            editdata = {edit_category: $("#edit_category").val(), id_category: $("#id_category").val()};


            $.ajax({


                type:"POST",


                url: "' .$url. '", 


                data: editdata,


                success: function() {}


               });


             


            $(this).dialog("close");


            }',


            'Cancel'=>'js: function() {$(this).dialog("close");}'),


        ),


    ));


?>





<script>alert($('#dialogModifyCategory').data('category'));</script>





<?php    


 echo "<a class='assetLabel2' style='left: 25px'>Edit Category</a>";


 echo '</br>';


 echo CHtml::textField('edit_category',$assetData['category'], array('class'=>'assetEntry', 'style'=>'left: 25px'));


 $this->endWidget('zii.widgets.jui.CJuiDialog');