/** * Create and setup QListBox lstTransactionType * @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 lstTransactionType_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstTransactionType = new QListBox($this->objParentObject, $strControlId); $this->lstTransactionType->Name = QApplication::Translate('Transaction Type'); $this->lstTransactionType->Required = true; if (!$this->blnEditMode) { $this->lstTransactionType->AddItem(QApplication::Translate('- Select One -'), null); } // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objTransactionTypeCursor = TransactionType::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objTransactionType = TransactionType::InstantiateCursor($objTransactionTypeCursor)) { $objListItem = new QListItem($objTransactionType->__toString(), $objTransactionType->TransactionTypeId); if ($this->objTransaction->TransactionType && $this->objTransaction->TransactionType->TransactionTypeId == $objTransactionType->TransactionTypeId) { $objListItem->Selected = true; } $this->lstTransactionType->AddItem($objListItem); } // Return the QListBox return $this->lstTransactionType; }