delete方法死活执行不了,急啊

我用crud生成的my_messageController,在执行delete里,在admin里可以执行,可是在list中死活执行不了,我的list中的delete是copyadmin中的,为什么啊,郁闷了一上午,大家救我啊

我在list页是可以得到id的,可是在controller里为什么就不可以哪

你最好能贴一下code, controller and view.

你觉得可以检查一下delete使用的方法,注意CHtml::link 和CHtml::linkButton的区别。

list中的代码是这样的

      <?php echo CHtml::linkButton('Delete',array(

							&nbsp; &nbsp; &nbsp; 	&nbsp; &#039;submit&#039;=&gt;&#039;&#039;,


							&nbsp; &nbsp; &nbsp; 	&nbsp; &#039;params&#039;=&gt;array(&#039;command&#039;=&gt;&#039;delete&#039;,&#039;id&#039;=&gt;$model-&gt;id),


							&nbsp; &nbsp; &nbsp; 	&nbsp; &#039;confirm&#039;=&gt;&quot;你确定要删除吗? #{$model-&gt;id}&quot;)); 

        ?>

my_messageController中为下面的

protected function processAdminCommand()


{


	if(isset($_POST&#91;&#039;command&#039;], $_POST&#91;&#039;id&#039;]) &amp;&amp; $_POST&#91;&#039;command&#039;]===&#039;delete&#039;)


	{

// echo '########';

// exit;

		$this-&gt;loadmy_message($_POST&#91;&#039;id&#039;])-&gt;delete();


		// reload the current page to avoid duplicated delete actions


		$this-&gt;refresh();


	}


}








public function loadmy_message($id=null)


{


	if($this-&gt;_my_message===null)


	{


		echo $_GET&#91;&#039;id&#039;];


		if($id!==null || isset($_GET&#91;&#039;id&#039;]))


			$this-&gt;_my_message=my_message::model()-&gt;findbyPk($id!==null ? $id : $_POST&#91;&#039;id&#039;]);


		if($this-&gt;_my_message===null)


			throw new CHttpException(500,&#039;The requested my_message does not exist.&#039;);


	}


	return $this-&gt;_my_message;


}

public function actionDelete()

{


	$this-&gt;processAdminCommand();


	if(Yii::app()-&gt;request-&gt;isPostRequest)


	{echo &quot;ssssssssssssss&quot;;


	exit;


		// we only allow deletion via POST request


		$this-&gt;loadmy_message()-&gt;delete();


		$this-&gt;redirect(array(&#039;list&#039;));


	}


	else


		throw new CHttpException(500,&#039;Invalid request. Please do not repeat this request again.&#039;);


}

你的list方法在哪里?对应的view呢?

嘻嘻,解决了,一直没回