Beispiel #1
0
 protected function Form_Create()
 {
     // Use the CreateFromPathInfo shortcut (this can also be done manually using the PeopledetailsMetaControl constructor)
     // MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent
     $this->mctPeopledetails = PeopledetailsMetaControl::CreateFromPathInfo($this);
     // Call MetaControl's methods to create qcontrols based on Peopledetails's data fields
     $this->lblId = $this->mctPeopledetails->lblId_Create();
     $this->txtFullName = $this->mctPeopledetails->txtFullName_Create();
     $this->txtAddress = $this->mctPeopledetails->txtAddress_Create();
     $this->txtPhone = $this->mctPeopledetails->txtPhone_Create();
     $this->txtEmail = $this->mctPeopledetails->txtEmail_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 QServerAction('btnSave_Click'));
     $this->btnSave->CausesValidation = true;
     $this->btnCancel = new QButton($this);
     $this->btnCancel->Text = QApplication::Translate('Cancel');
     $this->btnCancel->AddAction(new QClickEvent(), new QServerAction('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('Contact') . '?'));
     $this->btnDelete->AddAction(new QClickEvent(), new QServerAction('btnDelete_Click'));
     $this->btnDelete->Visible = $this->mctPeopledetails->EditMode;
 }
 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 = 'PeopledetailsEditPanel.tpl.php';
     $this->strClosePanelMethod = $strClosePanelMethod;
     // Construct the PeopledetailsMetaControl
     // MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent
     $this->mctPeopledetails = PeopledetailsMetaControl::Create($this, $intId);
     // Call MetaControl's methods to create qcontrols based on Peopledetails's data fields
     $this->lblId = $this->mctPeopledetails->lblId_Create();
     $this->txtFullName = $this->mctPeopledetails->txtFullName_Create();
     $this->txtAddress = $this->mctPeopledetails->txtAddress_Create();
     $this->txtPhone = $this->mctPeopledetails->txtPhone_Create();
     $this->txtEmail = $this->mctPeopledetails->txtEmail_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('Peopledetails') . '?'));
     $this->btnDelete->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnDelete_Click'));
     $this->btnDelete->Visible = $this->mctPeopledetails->EditMode;
 }
 /**
  * Static Helper Method to Create using QueryString arguments
  *
  * @param mixed $objParentObject QForm or QPanel which will be using this PeopledetailsMetaControl
  * @param QMetaControlCreateType $intCreateType rules governing Peopledetails object creation - defaults to CreateOrEdit
  * @return PeopledetailsMetaControl
  */
 public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     $intId = QApplication::QueryString('intId');
     return PeopledetailsMetaControl::Create($objParentObject, $intId, $intCreateType);
 }