/** * Create and setup QListBox lstTopicLink * @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 lstTopicLink_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstTopicLink = new QListBox($this->objParentObject, $strControlId); $this->lstTopicLink->Name = QApplication::Translate('Topic Link'); $this->lstTopicLink->Required = true; if (!$this->blnEditMode) { $this->lstTopicLink->AddItem(QApplication::Translate('- Select One -'), null); } // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objTopicLinkCursor = TopicLink::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objTopicLink = TopicLink::InstantiateCursor($objTopicLinkCursor)) { $objListItem = new QListItem($objTopicLink->__toString(), $objTopicLink->Id); if ($this->objMessage->TopicLink && $this->objMessage->TopicLink->Id == $objTopicLink->Id) { $objListItem->Selected = true; } $this->lstTopicLink->AddItem($objListItem); } // Return the QListBox return $this->lstTopicLink; }