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