/** * Create and setup QListBox lstInventoryLocation * @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 lstInventoryLocation_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstInventoryLocation = new QListBox($this->objParentObject, $strControlId); $this->lstInventoryLocation->Name = QApplication::Translate('Inventory Location'); $this->lstInventoryLocation->Required = true; if (!$this->blnEditMode) { $this->lstInventoryLocation->AddItem(QApplication::Translate('- Select One -'), null); } // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objInventoryLocationCursor = InventoryLocation::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objInventoryLocation = InventoryLocation::InstantiateCursor($objInventoryLocationCursor)) { $objListItem = new QListItem($objInventoryLocation->__toString(), $objInventoryLocation->InventoryLocationId); if ($this->objInventoryTransaction->InventoryLocation && $this->objInventoryTransaction->InventoryLocation->InventoryLocationId == $objInventoryLocation->InventoryLocationId) { $objListItem->Selected = true; } $this->lstInventoryLocation->AddItem($objListItem); } // Return the QListBox return $this->lstInventoryLocation; }