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