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