/** * Create and setup QListBox lstInventoryModelCustomFieldHelper * @param string $strControlId optional ControlId to use * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query * @return QListBox */ public function lstInventoryModelCustomFieldHelper_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstInventoryModelCustomFieldHelper = new QListBox($this->objParentObject, $strControlId); $this->lstInventoryModelCustomFieldHelper->Name = QApplication::Translate('Inventory Model Custom Field Helper'); $this->lstInventoryModelCustomFieldHelper->AddItem(QApplication::Translate('- Select One -'), null); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objInventoryModelCustomFieldHelperCursor = InventoryModelCustomFieldHelper::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objInventoryModelCustomFieldHelper = InventoryModelCustomFieldHelper::InstantiateCursor($objInventoryModelCustomFieldHelperCursor)) { $objListItem = new QListItem($objInventoryModelCustomFieldHelper->__toString(), $objInventoryModelCustomFieldHelper->InventoryModelId); if ($objInventoryModelCustomFieldHelper->InventoryModelId == $this->objInventoryModel->InventoryModelId) { $objListItem->Selected = true; } $this->lstInventoryModelCustomFieldHelper->AddItem($objListItem); } // Because InventoryModelCustomFieldHelper's InventoryModelCustomFieldHelper is not null, if a value is already selected, it cannot be changed. if ($this->lstInventoryModelCustomFieldHelper->SelectedValue) { $this->lstInventoryModelCustomFieldHelper->Enabled = false; } // Return the QListBox return $this->lstInventoryModelCustomFieldHelper; }