public function __construct($objParentObject, $strClosePanelMethod, $intId = null, $strControlId = null)
 {
     // Call the Parent
     try {
         parent::__construct($objParentObject, $strControlId);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     // Setup Callback and Template
     $this->strTemplate = 'SharedetailsEditPanel.tpl.php';
     $this->strClosePanelMethod = $strClosePanelMethod;
     // Construct the SharedetailsMetaControl
     // MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent
     $this->mctSharedetails = SharedetailsMetaControl::Create($this, $intId);
     // Call MetaControl's methods to create qcontrols based on Sharedetails's data fields
     $this->lblId = $this->mctSharedetails->lblId_Create();
     $this->txtAsin = $this->mctSharedetails->txtAsin_Create();
     $this->txtEmail = $this->mctSharedetails->txtEmail_Create();
     $this->calTakenDate = $this->mctSharedetails->calTakenDate_Create();
     $this->calReturnDate = $this->mctSharedetails->calReturnDate_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 QAjaxControlAction($this, 'btnSave_Click'));
     $this->btnSave->CausesValidation = $this;
     $this->btnCancel = new QButton($this);
     $this->btnCancel->Text = QApplication::Translate('Cancel');
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
     $this->btnDelete = new QButton($this);
     $this->btnDelete->Text = QApplication::Translate('Delete');
     $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction(QApplication::Translate('Are you SURE you want to DELETE this') . ' ' . QApplication::Translate('Sharedetails') . '?'));
     $this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
     $this->btnDelete->Visible = $this->mctSharedetails->EditMode;
 }
示例#2
0
 protected function Form_Create()
 {
     // Use the CreateFromPathInfo shortcut (this can also be done manually using the SharedetailsMetaControl constructor)
     // MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent
     $this->mctSharedetails = SharedetailsMetaControl::CreateFromPathInfo($this);
     // Call MetaControl's methods to create qcontrols based on Sharedetails's data fields
     $this->lblId = $this->mctSharedetails->lblId_Create();
     $this->txtAsin = $this->mctSharedetails->txtAsin_Create();
     $this->txtEmail = $this->mctSharedetails->txtEmail_Create();
     $this->calTakenDate = $this->mctSharedetails->calTakenDate_Create();
     $this->calReturnDate = $this->mctSharedetails->calReturnDate_Create();
     $this->txtTitle = $this->mctSharedetails->txtTitle_Create();
     $this->txtFullName = $this->mctSharedetails->txtFullName_Create();
     $this->calActualReturnDate = new QDateTimePicker($this);
     $this->calActualReturnDate->Name = QApplication::Translate('Actual Return Date');
     /*			$this->calActualReturnDate->DateTime = $this->objSharedetails->TakenDate;*/
     $this->calActualReturnDate->DateTimePickerType = QDateTimePickerType::Date;
     // 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('Return');
     $this->btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Click'));
     $this->btnDelete->Visible = $this->mctSharedetails->EditMode;
 }
 /**
  * Static Helper Method to Create using QueryString arguments
  *
  * @param mixed $objParentObject QForm or QPanel which will be using this SharedetailsMetaControl
  * @param QMetaControlCreateType $intCreateType rules governing Sharedetails object creation - defaults to CreateOrEdit
  * @return SharedetailsMetaControl
  */
 public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     $intId = QApplication::QueryString('intId');
     return SharedetailsMetaControl::Create($objParentObject, $intId, $intCreateType);
 }