problem with loadin jui

Hello guys.

I have the following code:

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


    // additional javascript options for the dialog plugin







    echo 'myMessage!';


As far as I know this code placed in a view must load jui library automatically but it does not.

It does not work untill I include jui using this code:


in my layout.

Do I miss anything?

It’s a mistery. It works. But I did not do anything special. Strange.