when using CHTML:listView, an empty selection is not transmitted correctly #235

Closed
qiangxue opened this Issue Feb 15, 2012 · 0 comments

Comments

2 participants
Owner

qiangxue commented Feb 15, 2012

What steps will reproduce the problem?
1.
create a form with a CHTML::listView().
2.
Select multiple items in the listView
3.
submit the form
4.
when now inspecting $_POST[$form], the listView variable is a correct array of several items.

BUT
when selecting nothing, there is no POST value for the listbox - in contrast to e.g. CHTML::activeCheckBoxList(), which will return false if no selection was made, see here:
http://www.yiiframework.com/doc/api/1.1/CHtml#activeCheckBoxList-detail

What is the expected output? What do you see instead?
I'd also like to see a "false" POST value, as $model->attributes = $_POST[$form] breaks, if no value is present (it will retain old values, thus making it impossible to delete something)

What version of the product are you using? On what operating system?
Yii 1.1.8 Mac OS 10.7

Please provide any additional information below.

Migrated from http://code.google.com/p/yii/issues/detail?id=2783


earlier comments

qiang.xue said, at 2011-08-30T15:28:39.000Z:

There's no CHtml::listView.

simonbrueckner said, at 2011-08-30T15:31:21.000Z:

Ah sorry, I meant: CHtml::listBox

qiang.xue said, at 2012-01-01T03:37:10.000Z:

set for 1.1.10 milestone

qiang.xue said, at 2012-01-01T03:37:36.000Z:

set for 1.1.10 milestone

mdomba closed this May 5, 2012

mdomba was assigned May 5, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment