/** * Create and setup QListBox lstText * @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 lstText_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstText = new QListBox($this->objParentObject, $strControlId); $this->lstText->Name = QApplication::Translate('Text'); $this->lstText->Required = true; if (!$this->blnEditMode) { $this->lstText->AddItem(QApplication::Translate('- Select One -'), null); } // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objTextCursor = NarroText::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objText = NarroText::InstantiateCursor($objTextCursor)) { $objListItem = new QListItem($objText->__toString(), $objText->TextId); if ($this->objNarroContext->Text && $this->objNarroContext->Text->TextId == $objText->TextId) { $objListItem->Selected = true; } $this->lstText->AddItem($objListItem); } // Return the QListBox return $this->lstText; }