protected function Form_Create() { parent::Form_Create(); // Use the CreateFromPathInfo shortcut (this can also be done manually using the NarroFileProgressMetaControl constructor) // MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent $this->mctNarroFileProgress = NarroFileProgressMetaControl::CreateFromPathInfo($this); // Call MetaControl's methods to create qcontrols based on NarroFileProgress's data fields $this->lblFileProgressId = $this->mctNarroFileProgress->lblFileProgressId_Create(); $this->lstFile = $this->mctNarroFileProgress->lstFile_Create(); $this->lstLanguage = $this->mctNarroFileProgress->lstLanguage_Create(); $this->txtFileMd5 = $this->mctNarroFileProgress->txtFileMd5_Create(); $this->txtHeader = $this->mctNarroFileProgress->txtHeader_Create(); $this->txtTotalTextCount = $this->mctNarroFileProgress->txtTotalTextCount_Create(); $this->txtApprovedTextCount = $this->mctNarroFileProgress->txtApprovedTextCount_Create(); $this->txtFuzzyTextCount = $this->mctNarroFileProgress->txtFuzzyTextCount_Create(); $this->txtProgressPercent = $this->mctNarroFileProgress->txtProgressPercent_Create(); $this->chkExport = $this->mctNarroFileProgress->chkExport_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('NarroFileProgress')))); $this->btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Click')); $this->btnDelete->Visible = $this->mctNarroFileProgress->EditMode; }
/** * Static Helper Method to Create using QueryString arguments * * @param mixed $objParentObject QForm or QPanel which will be using this NarroFileProgressMetaControl * @param QMetaControlCreateType $intCreateType rules governing NarroFileProgress object creation - defaults to CreateOrEdit * @return NarroFileProgressMetaControl */ public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) { $intFileProgressId = QApplication::QueryString('intFileProgressId'); return NarroFileProgressMetaControl::Create($objParentObject, $intFileProgressId, $intCreateType); }