protected function Form_Create() { parent::Form_Create(); // Use the CreateFromPathInfo shortcut (this can also be done manually using the NarroContextInfoMetaControl constructor) // MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent $this->mctNarroContextInfo = NarroContextInfoMetaControl::CreateFromPathInfo($this); // Call MetaControl's methods to create qcontrols based on NarroContextInfo's data fields $this->lblContextInfoId = $this->mctNarroContextInfo->lblContextInfoId_Create(); $this->lstContext = $this->mctNarroContextInfo->lstContext_Create(); $this->lstLanguage = $this->mctNarroContextInfo->lstLanguage_Create(); $this->lstValidatorUser = $this->mctNarroContextInfo->lstValidatorUser_Create(); $this->lstValidSuggestion = $this->mctNarroContextInfo->lstValidSuggestion_Create(); $this->chkHasSuggestions = $this->mctNarroContextInfo->chkHasSuggestions_Create(); $this->txtSuggestionAccessKey = $this->mctNarroContextInfo->txtSuggestionAccessKey_Create(); $this->txtSuggestionCommandKey = $this->mctNarroContextInfo->txtSuggestionCommandKey_Create(); $this->calCreated = $this->mctNarroContextInfo->calCreated_Create(); $this->calModified = $this->mctNarroContextInfo->calModified_Create(); // Create Buttons and Actions on this Form $this->btnSave = new QButton($this); $this->btnSave->Text = QApplication::Translate('Save'); $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click')); $this->btnSave->CausesValidation = true; $this->btnCancel = new QButton($this); $this->btnCancel->Text = QApplication::Translate('Cancel'); $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click')); $this->btnDelete = new QButton($this); $this->btnDelete->Text = QApplication::Translate('Delete'); $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction(sprintf(QApplication::Translate('Are you SURE you want to DELETE this %s?'), QApplication::Translate('NarroContextInfo')))); $this->btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Click')); $this->btnDelete->Visible = $this->mctNarroContextInfo->EditMode; }