/** * Create and setup QListBox lstAssetTransactionCheckout * @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 lstAssetTransactionCheckout_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstAssetTransactionCheckout = new QListBox($this->objParentObject, $strControlId); $this->lstAssetTransactionCheckout->Name = QApplication::Translate('Asset Transaction Checkout'); $this->lstAssetTransactionCheckout->AddItem(QApplication::Translate('- Select One -'), null); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objAssetTransactionCheckoutCursor = AssetTransactionCheckout::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objAssetTransactionCheckout = AssetTransactionCheckout::InstantiateCursor($objAssetTransactionCheckoutCursor)) { $objListItem = new QListItem($objAssetTransactionCheckout->__toString(), $objAssetTransactionCheckout->AssetTransactionCheckoutId); if ($objAssetTransactionCheckout->AssetTransactionId == $this->objAssetTransaction->AssetTransactionId) { $objListItem->Selected = true; } $this->lstAssetTransactionCheckout->AddItem($objListItem); } // Because AssetTransactionCheckout's AssetTransactionCheckout is not null, if a value is already selected, it cannot be changed. if ($this->lstAssetTransactionCheckout->SelectedValue) { $this->lstAssetTransactionCheckout->Enabled = false; } // Return the QListBox return $this->lstAssetTransactionCheckout; }