/** * Create and setup QListBox lstCourier * @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 lstCourier_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstCourier = new QListBox($this->objParentObject, $strControlId); $this->lstCourier->Name = QApplication::Translate('Courier'); $this->lstCourier->AddItem(QApplication::Translate('- Select One -'), null); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objCourierCursor = Courier::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objCourier = Courier::InstantiateCursor($objCourierCursor)) { $objListItem = new QListItem($objCourier->__toString(), $objCourier->CourierId); if ($this->objShipment->Courier && $this->objShipment->Courier->CourierId == $objCourier->CourierId) { $objListItem->Selected = true; } $this->lstCourier->AddItem($objListItem); } // Return the QListBox return $this->lstCourier; }