/** * Create and setup QListBox lstAssetCustomFieldHelper * @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 lstAssetCustomFieldHelper_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstAssetCustomFieldHelper = new QListBox($this->objParentObject, $strControlId); $this->lstAssetCustomFieldHelper->Name = QApplication::Translate('Asset Custom Field Helper'); $this->lstAssetCustomFieldHelper->AddItem(QApplication::Translate('- Select One -'), null); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objAssetCustomFieldHelperCursor = AssetCustomFieldHelper::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objAssetCustomFieldHelper = AssetCustomFieldHelper::InstantiateCursor($objAssetCustomFieldHelperCursor)) { $objListItem = new QListItem($objAssetCustomFieldHelper->__toString(), $objAssetCustomFieldHelper->AssetId); if ($objAssetCustomFieldHelper->AssetId == $this->objAsset->AssetId) { $objListItem->Selected = true; } $this->lstAssetCustomFieldHelper->AddItem($objListItem); } // Because AssetCustomFieldHelper's AssetCustomFieldHelper is not null, if a value is already selected, it cannot be changed. if ($this->lstAssetCustomFieldHelper->SelectedValue) { $this->lstAssetCustomFieldHelper->Enabled = false; } // Return the QListBox return $this->lstAssetCustomFieldHelper; }