/** * (non-PHPdoc) * @see Element::renderControlEditable() */ protected function renderControlEditable() { $unserializedMetadata = unserialize($this->dropDownDependencyDerivedAttributeMetadata->serializedMetadata); $onChangeScript = null; $dependencyData = array(); $attributes = $this->dropDownDependencyDerivedAttributeMetadata->getUsedAttributeNames(); $content = "<table> \n"; $parentInputId = null; $parentAttributeLabel = null; foreach ($attributes as $position => $attribute) { $element = new DropDownElement($this->model, $attribute, $this->form, array('addBlank' => true)); $element->editableTemplate = $this->getEditableTemplate(); $content .= $element->render(); $inputId = $element->getIdForSelectInput(); $onChangeScript .= "\$('#" . $inputId . "').bind('change', function()\n {\n " . $this->getDependencyManagerResolveScriptCall() . "\n }\n );"; $dependencyData[] = $this->resolveDependencyData($inputId, $parentInputId, $unserializedMetadata['mappingData'], $position, $this->model->{$attribute}->value, $parentAttributeLabel); $parentInputId = $inputId; $parentAttributeLabel = $this->model->getAttributeLabel($attribute); } $content .= "</table> \n"; $this->resolveScriptContent($onChangeScript, $dependencyData); return $content; }