Hello,
I have been trying to gather tabular input. The idea is for me to insert around 6 or 7 records.
i am using this as my guide
http://www.yiiframew...uide/form.table
I keep getting the error..
Property "Item." is not defined.
this error is from the line
<? echo CHtml::activeTextField($item,"[$i]count"); ?>
Can anybody guide me please ?
thanks
Arvind
Page 1 of 1
Gathering Tabular Input - Property "Item." is not defined.
#2
Posted 24 October 2009 - 07:43 PM
Works for me!
You are on 1.1a, right? Syntax change, [$i]attr instead of attr[$i].
Also check that the attribute 'count' exists and has the correct case.
/Tommy
You are on 1.1a, right? Syntax change, [$i]attr instead of attr[$i].
Also check that the attribute 'count' exists and has the correct case.
/Tommy
#3
Posted 24 October 2009 - 07:59 PM
tri, on 24 October 2009 - 07:43 PM, said:
Works for me!
You are on 1.1a, right? Syntax change, [$i]attr instead of attr[$i].
Also check that the attribute 'count' exists and has the correct case.
/Tommy
You are on 1.1a, right? Syntax change, [$i]attr instead of attr[$i].
Also check that the attribute 'count' exists and has the correct case.
/Tommy
No, i am on 1.0.10. actually the attribute is TIMESPENT. and it still complains with that same error.
I managed a hack in this way. Let me know if this is not good.
echo CHtml::activeTextField($item,"TIMESPENT",array('name'=>'LifeProfile['.$item->ACTIVITYID.'][TIMESPENT]') ;
thanks
Arvind
#4
Posted 24 October 2009 - 08:33 PM
Here is an excerpt from the 1.0.10 guide, the section on tabular input
Older versions of the pdf guide are available to download
http://www.yiiframew...s-1.0.10.tar.gz
http://www.yiiframew...docs-1.0.10.zip
/Tommy
<div class="yiiForm"> <?php echo CHtml::beginForm(); ?> <table> <tr><th>Name</th><th>Price</th><th>Count</th><th>Description</th></tr> <?php foreach($items as $i=>$item): ?> <tr> <td><?php echo CHtml::activeTextField($item,"name[$i]"); ?></td> <td><?php echo CHtml::activeTextField($item,"price[$i]"); ?></td> <td><?php echo CHtml::activeTextField($item,"count[$i]"); ?></td> <td><?php echo CHtml::activeTextArea($item,"description[$i]"); ?></td> </tr> <?php endforeach; ?> </table>
Older versions of the pdf guide are available to download
http://www.yiiframew...s-1.0.10.tar.gz
http://www.yiiframew...docs-1.0.10.zip
/Tommy
Share this topic:
Page 1 of 1

Help
This topic is locked












