示例#1
0
 public function SetControlValuesFromDataset()
 {
     if (GetOperation() == OPERATION_EDIT || GetOperation() == OPERATION_AJAX_REQUERT_INLINE_EDIT) {
         $this->GetEditControl()->SetDisplayValue($this->GetDisplayValueFromDataset());
     } elseif (GetOperation() == OPERATION_COPY) {
         $this->GetEditControl()->SetDisplayValue($this->GetDisplayValueFromDataset());
         /* $masterFieldValue = $this->dataset->GetMasterFieldValueByName($this->fieldName);
            if (isset($masterFieldValue))
                $this->editControl->SetValue($masterFieldValue); */
     } elseif (GetOperation() == OPERATION_INSERT || GetOperation() == OPERATION_AJAX_REQUERT_INLINE_INSERT) {
         $insertDefaultValue = $this->GetInsertDefaultValue();
         if (isset($insertDefaultValue)) {
             $this->lookupDataset->AddFieldFilter($this->lookupIdFieldName, new FieldFilter($insertDefaultValue, '='));
             $this->lookupDataset->Open();
             if ($this->lookupDataset->Next()) {
                 $displayValue = $this->lookupDataset->GetFieldValueByName($this->lookupDisplayFieldName);
                 $this->GetEditControl()->SetDisplayValue($displayValue);
             }
             $this->lookupDataset->Close();
         }
     }
     parent::SetControlValuesFromDataset();
 }