/** * Create and setup QListBox lstOtherContactMethod * @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 lstOtherContactMethod_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstOtherContactMethod = new QListBox($this->objParentObject, $strControlId); $this->lstOtherContactMethod->Name = QApplication::Translate('Other Contact Method'); $this->lstOtherContactMethod->Required = true; if (!$this->blnEditMode) { $this->lstOtherContactMethod->AddItem(QApplication::Translate('- Select One -'), null); } // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objOtherContactMethodCursor = OtherContactMethod::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objOtherContactMethod = OtherContactMethod::InstantiateCursor($objOtherContactMethodCursor)) { $objListItem = new QListItem($objOtherContactMethod->__toString(), $objOtherContactMethod->Id); if ($this->objOtherContactInfo->OtherContactMethod && $this->objOtherContactInfo->OtherContactMethod->Id == $objOtherContactMethod->Id) { $objListItem->Selected = true; } $this->lstOtherContactMethod->AddItem($objListItem); } // Return the QListBox return $this->lstOtherContactMethod; }