/** * Create and setup QListBox lstCheckingAccountLookup * @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 lstCheckingAccountLookup_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstCheckingAccountLookup = new QListBox($this->objParentObject, $strControlId); $this->lstCheckingAccountLookup->Name = QApplication::Translate('Checking Account Lookup'); $this->lstCheckingAccountLookup->AddItem(QApplication::Translate('- Select One -'), null); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objCheckingAccountLookupCursor = CheckingAccountLookup::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objCheckingAccountLookup = CheckingAccountLookup::InstantiateCursor($objCheckingAccountLookupCursor)) { $objListItem = new QListItem($objCheckingAccountLookup->__toString(), $objCheckingAccountLookup->Id); if ($this->objStewardshipContribution->CheckingAccountLookup && $this->objStewardshipContribution->CheckingAccountLookup->Id == $objCheckingAccountLookup->Id) { $objListItem->Selected = true; } $this->lstCheckingAccountLookup->AddItem($objListItem); } // Return the QListBox return $this->lstCheckingAccountLookup; }
/** * Create and setup QListBox lstCheckingAccountLookups * @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 lstCheckingAccountLookups_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstCheckingAccountLookups = new QListBox($this->objParentObject, $strControlId); $this->lstCheckingAccountLookups->Name = QApplication::Translate('Checking Account Lookups'); $this->lstCheckingAccountLookups->SelectionMode = QSelectionMode::Multiple; // We need to know which items to "Pre-Select" $objAssociatedArray = $this->objPerson->GetCheckingAccountLookupArray(); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objCheckingAccountLookupCursor = CheckingAccountLookup::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objCheckingAccountLookup = CheckingAccountLookup::InstantiateCursor($objCheckingAccountLookupCursor)) { $objListItem = new QListItem($objCheckingAccountLookup->__toString(), $objCheckingAccountLookup->Id); foreach ($objAssociatedArray as $objAssociated) { if ($objAssociated->Id == $objCheckingAccountLookup->Id) { $objListItem->Selected = true; } } $this->lstCheckingAccountLookups->AddItem($objListItem); } // Return the QListControl return $this->lstCheckingAccountLookups; }