I have a view form with EDialog in it and
$this->beginWidget('application.extensions.jui.EDialog',
array(
'name' => 'myDialog',
'theme'=>'redmond',
'compression'=>'none',
'htmlOptions'=>array('title'=>'Hello dialog'),
'options'=>array(
'autoOpen'=>false,
'show'=>'scale',
'bgiframe'=>true,
'width'=>400,
'modal'=>true, /* this makes the dialog, appear on a overlay */
),
'buttons' => array(
"Ok" => 'function(){$(this).dialog("close");}',
)
)
);
//here is Qiang's sample code that I moved!
echo CHtml::form();
echo CHtml::textField('name');
echo CHtml::ajaxLink('submit', array('echo'), array(
'type'=>'POST',
'update'=>'#result',
));
//and changed a bit by echo ...
echo '</form>';
echo '<div id="result">';
echo 'Something have to be replace by actionEcho controller ...';
echo '</div>';
$this->endWidget('application.extensions.jui.EDialog');
And my actionEcho controller function code as :
public function actionEcho()
{
if(Yii::app()->request->isAjaxRequest)
{
if(isset($_POST['name'])) {
if ($_POST['name'] !=''){
echo "You entered: ".CHtml::encode($_POST['name']);
}
}
From my code there , when I call the AjaxButton , it somehow did call to "actionEcho" and replace the text
"Something have to be replace by actionEcho controller ..."
but it will always return with blank.
How can I achive by Ajax calling and then return the result into the DIALOG's <div id= "myDialog"> Area and this is basically a popup search dialog ?
Please advise , Thanks.

Help














