tbl_city(id,name,commune_id) tbl_comune(id,name) tbl_observation(id, name, city_id)
I've 3 models too and defined relations:
City('idCommune' => array(self::BELONGS_TO, 'Commune', 'commune_id'), Commune(without defined relations) Observation('idCity' => array(self::BELONGS_TO, 'City', 'city_id').
In my _form view i've got this textFieldRow:
When i try to edit my observation everything works fine, but when i try to create new observatoins i've got this error:
TbInput: Failed to initialize widget! Model is not set.
I think that this error is caused, because when i try to create a new observation my _form view try to load Commune name, but it's empty. Can you help me with this?
Sorry for my english