public function __construct($objParentObject, $strClosePanelMethod, $arrayCompanyId) { try { parent::__construct($objParentObject, $strClosePanelMethod); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } $this->arrCompaniesToEdit = $arrayCompanyId; $this->txtLongDescription_Create(); $this->chkLongDescription_Create(); $this->btnSave->AddAction(new QClickEvent(), new QConfirmAction('Are you sure you want to edit these items?')); $this->strOverflow = QOverflow::Auto; $objCustomFieldArray = CustomField::LoadObjCustomFieldArray(EntityQtype::Company, false); if (count($objCustomFieldArray) > 0) { $this->arrCustomFields = CustomField::CustomFieldControlsCreate($objCustomFieldArray, false, $this, true, true, false); foreach ($this->arrCustomFields as $field) { $field['input']->Enabled = false; $this->arrCheckboxes[$field['input']->strControlId] = new QCheckBox($this, 'chk' . $field['input']->strControlId); $this->arrCheckboxes[$field['input']->strControlId]->Checked = false; $this->arrCheckboxes[$field['input']->strControlId]->AddAction(new QClickEvent(), new QJavaScriptAction("enableInput(this)")); } $this->txtLongDescription->Enabled = false; } //$this->btnSave->CausesValidation = QCausesValidation::SiblingsOnly; }
public function __construct($objParentObject, $strClosePanelMethod, $objCompany = null, $strControlId = null) { try { parent::__construct($objParentObject, $strClosePanelMethod, $objCompany, $strControlId); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } $this->txtAddressShortDescription_Create(); $this->txtAddress1_Create(); $this->txtAddress2_Create(); $this->txtCity_Create(); $this->lstStateProvince_Create(); $this->txtPostalCode_Create(); $this->lstCountry_Create(); $this->arrAddressCustomFields_Create(); // Create all custom asset model fields $this->customFields_Create(); // Set Display logic of the Custom Fields $this->UpdateCustomFields(); // Add Enter Key Events to each control except the Cancel Button $arrControls = array($this->txtShortDescription, $this->txtLongDescription, $this->txtWebsite, $this->txtEmail, $this->txtTelephone, $this->txtFax, $this->txtAddressShortDescription, $this->txtAddress1, $this->txtAddress2, $this->txtCity, $this->lstStateProvince, $this->txtPostalCode); foreach ($arrControls as $ctlControl) { $ctlControl->CausesValidation = true; $ctlControl->AddAction(new QEnterKeyEvent(), new QAjaxControlAction($this, 'btnSave_Click')); $ctlControl->AddAction(new QEnterKeyEvent(), new QTerminateAction()); } $this->strOverflow = QOverflow::Auto; $this->btnSave->CausesValidation = QCausesValidation::SiblingsOnly; }