Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Table Field


Reply

2 Posts   765 Views

Avatar
Dr0gaz

1 April 2011 at 4:51am Community Member, 37 Posts

hi guys i've a table field inside my dataobject... but the table works badly.... when delete one record ... my dataobject show white... and when i add a record a ive a checkbox... this checkbox show enable but.. disable others chebox in table why?

<?php
// /mysite/code/Divisao.php
class Divisao extends DataObject {
   static $db = array (
'Nome' => 'Varchar(255)'
);

static $has_one = array (
'ObraPage' => 'ObraPage'
);

static $has_many = array (
   'Detalhes' => 'Detalhe'
   );

   public function getCMSFields_forPopup()
   {
      if( $this->ID == NULL ){
         return new FieldSet(
         new TextField('Nome','Assoalhada')
      );
      } else{
      
         return new FieldSet(
         new TextField('Nome','Assoalhada'),
      
          new TableField(
                    //'Detalhes',
             'Detalhes',
             'Detalhe',
                    array('Nome' => 'Nome', 'Estado' => 'Estado'),
                    array('Nome' => 'TextField', "Estado" => "OptionsetField('Estado','Estado',singleton('Detalhe')->dbObject('Estado')->enumValues())" ),
             "DivisaoID",$this->ID
           //"DropdownField('Estado','Estado',singleton('Detalhe')->dbObject('Estado')->enumValues())"
         
....

<?php
class Detalhe extends DataObject {
static $db = array (
'Nome' => 'Varchar(255)',
"Estado" => "Enum('Caracteristica,Acabamento','Caracteristica')"
);

static $has_many = array (
   
);

static $has_one = array (
'Divisao' => 'Divisao'
);

}

Avatar
UncleCheese

7 April 2011 at 7:29am 4085 Posts

Yeah, I don't think that's ever going to work. Way too many dependency conflicts.