Yii Framework Forum: Collecting Tabular Input with zii jui widgets is broken? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Collecting Tabular Input with zii jui widgets is broken? Property "item." is not defined. Rate Topic: ***** 1 Votes

#1 User is offline   DarkNSF 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 287
  • Joined: 12-November 08
  • Location:Palm Bay, Florida

Posted 25 July 2010 - 02:46 PM

I was looking at http://www.yiiframew...uide/form.table for doing some batch updates. It appears to break with the zii jui widgets.


      <div class="row">
        <?php echo CHtml::activeLabelEx($item,'dateAssigned'); ?>
        <?php
              $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                  'model'=>$item,
                  'attribute'=>'['.$i.']dateAssigned',
                  'options'=>array(
                      'showAnim'=>'fold',
                      'dateFormat'=>'yy-mm-dd',
                  ),
              ));
            ?>
        <?php echo CHtml::error($item,'dateAssigned'); ?>
      </div>



Error:
Property "item." is not defined.

0

#2 User is offline   DarkNSF 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 287
  • Joined: 12-November 08
  • Location:Palm Bay, Florida

Posted 25 July 2010 - 03:14 PM

View PostDarkNSF, on 25 July 2010 - 02:46 PM, said:

I was looking at http://www.yiiframew...uide/form.table for doing some batch updates. It appears to break with the zii jui widgets.


      <div class="row">
        <?php echo CHtml::activeLabelEx($item,'dateAssigned'); ?>
        <?php
              $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                  'model'=>$item,
                  'attribute'=>'['.$i.']dateAssigned',
                  'options'=>array(
                      'showAnim'=>'fold',
                      'dateFormat'=>'yy-mm-dd',
                  ),
              ));
            ?>
        <?php echo CHtml::error($item,'dateAssigned'); ?>
      </div>



Error:
Property "item." is not defined.




I did some debugging in and it appears that it has to do with this code in CJuiDatePicker:
		if(isset($this->htmlOptions['name']))
			$name=$this->htmlOptions['name'];
		else
			$this->htmlOptions['name']=$name;

		if($this->hasModel())
			echo CHtml::activeTextField($this->model,$this->attribute,$this->htmlOptions);



if you comment out:
		//else
			//$this->htmlOptions['name']=$name;

everything works
0

#3 User is offline   DarkNSF 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 287
  • Joined: 12-November 08
  • Location:Palm Bay, Florida

Posted 26 July 2010 - 08:59 AM

bump? I am considering posting this to the bugs section.
0

#4 User is offline   zaccaria 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 2,232
  • Joined: 04-October 09
  • Location:Moscow

Posted 27 July 2010 - 07:35 AM

I don't know exactly this case, but in many examples tabular input is not working properly with widget or CHtml.

Usually I solve by calling a CHtml::resolveNameId() in some part of my widget. Maybe in CJuiDatePicker that one is missing.

I guess that is a bug, but before posting in bug section try to solve by editing the code of CJuiWidget, so you can present to staff bug + solution, and they will answer you sooner (maybe).
0

#5 User is offline   fourcs 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 16-April 09

Posted 27 July 2010 - 09:36 AM

hi, Your fix works for me as well. Thanks
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users