コード例 #1
0
 /**
  * Create and setup QListBox lstIssueFieldOption
  * @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 lstIssueFieldOption_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null)
 {
     $this->lstIssueFieldOption = new QListBox($this->objParentObject, $strControlId);
     $this->lstIssueFieldOption->Name = QApplication::Translate('Issue Field Option');
     $this->lstIssueFieldOption->Required = true;
     if (!$this->blnEditMode) {
         $this->lstIssueFieldOption->AddItem(QApplication::Translate('- Select One -'), null);
     }
     // Setup and perform the Query
     if (is_null($objCondition)) {
         $objCondition = QQ::All();
     }
     $objIssueFieldOptionCursor = IssueFieldOption::QueryCursor($objCondition, $objOptionalClauses);
     // Iterate through the Cursor
     while ($objIssueFieldOption = IssueFieldOption::InstantiateCursor($objIssueFieldOptionCursor)) {
         $objListItem = new QListItem($objIssueFieldOption->__toString(), $objIssueFieldOption->Id);
         if ($this->objIssueFieldValue->IssueFieldOption && $this->objIssueFieldValue->IssueFieldOption->Id == $objIssueFieldOption->Id) {
             $objListItem->Selected = true;
         }
         $this->lstIssueFieldOption->AddItem($objListItem);
     }
     // Return the QListBox
     return $this->lstIssueFieldOption;
 }