Inheritance: extends QListControl
コード例 #1
0
ファイル: add.php プロジェクト: alcf/chms
 protected function Form_Create()
 {
     // Display: Username
     $this->txtUsername = new QTextBox($this);
     $this->txtUsername->Name = 'Username';
     // Display: First Name
     $this->txtFirstName = new QTextBox($this);
     $this->txtFirstName->Name = 'First Name';
     // Display: Last Name
     $this->txtLastName = new QTextBox($this);
     $this->txtLastName->Name = 'Last Name';
     // Display: Email
     $this->txtEmail = new QTextBox($this);
     $this->txtEmail->Name = 'Email';
     foreach (Ministry::LoadAll(QQ::OrderBy(QQN::Ministry()->Name)) as $objMinistry) {
         $rblMinistry = new QRadioButtonList($this);
         $rblMinistry->Name = $objMinistry->Name;
         $rblMinistry->AddItem('Yes', $objMinistry->Id, false);
         $rblMinistry->AddItem('No', 0, true);
         $rblMinistry->RepeatColumns = 2;
         $this->rblMinistryArray[] = $rblMinistry;
     }
     $this->lstRoleType = new QListBox($this);
     $this->lstRoleType->Name = 'Role';
     foreach (RoleType::$NameArray as $intKey => $strName) {
         $this->lstRoleType->AddItem($strName, $intKey, false);
     }
     $this->rblLoginActive = new QRadioButtonList($this);
     $this->rblLoginActive->Name = 'ChMS Login Enabled';
     $this->rblLoginActive->AddItem('Yes', true, true);
     $this->rblLoginActive->AddItem('No', false, false);
     $this->rblLoginActive->RepeatColumns = 2;
     foreach (PermissionType::$NameArray as $intId => $strName) {
         $rblPermission = new QRadioButtonList($this);
         $rblPermission->Name = 'Can ' . $strName;
         $rblPermission->AddItem('Yes', $intId, false);
         $rblPermission->AddItem('No', 0, true);
         $rblPermission->RepeatColumns = 2;
         $this->rblPermissionArray[] = $rblPermission;
     }
     $this->txtNewPassword = new QTextBox($this);
     $this->txtNewPassword->Name = 'Set Password: '******'Update';
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
     $this->btnSave->CssClass = 'primary';
     $this->btnCancel = new QLinkButton($this);
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
     $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
     $this->btnCancel->CssClass = 'cancel';
 }
コード例 #2
0
ファイル: add.php プロジェクト: alcf/chms
 protected function Form_Create()
 {
     $this->strFirstName = new QTextBox($this);
     $this->strFirstName->Name = "First Name: ";
     $this->strLastName = new QTextBox($this);
     $this->strLastName->Name = "Last Name: ";
     $this->strEmail = new QEmailTextBox($this);
     $this->strEmail->Name = "Email: ";
     $this->strUserName = new QTextBox($this);
     $this->strUserName->Name = "User Name: ";
     $this->strUserName->Required = true;
     $this->strPassword = new QTextBox($this);
     $this->strPassword->Name = 'Password';
     $this->strPassword->TextMode = QTextMode::Password;
     $this->strPassword->Required = true;
     $this->strPassword->CausesValidation = true;
     $this->lstActiveFlag = new QListBox($this);
     $this->lstActiveFlag->Name = 'Active';
     $this->lstActiveFlag->AddItem('Active', true, true);
     $this->lstActiveFlag->AddItem('Inactive', false);
     foreach (Ministry::LoadAll(QQ::OrderBy(QQN::Ministry()->Name)) as $objMinistry) {
         $rblMinistry = new QRadioButtonList($this);
         $rblMinistry->Name = $objMinistry->Name;
         $rblMinistry->AddItem('Yes', $objMinistry->Id, false);
         $rblMinistry->AddItem('No', 0, true);
         $rblMinistry->RepeatColumns = 2;
         $this->rblMinistryArray[] = $rblMinistry;
     }
     foreach (PermissionType::$NameArray as $intId => $strName) {
         $rblPermission = new QRadioButtonList($this);
         $rblPermission->Name = 'Can ' . $strName;
         $rblPermission->AddItem('Yes', $intId, false);
         $rblPermission->AddItem('No', 0, true);
         $rblPermission->RepeatColumns = 2;
         $this->rblPermissionArray[] = $rblPermission;
     }
     $this->btnSubmit = new QButton($this);
     $this->btnSubmit->Text = "Submit";
     $this->btnSubmit->AddAction(new QClickEvent(), new QAjaxAction('btnSubmit_Click'));
     $this->btnCancel = new QButton($this);
     $this->btnCancel->Text = "Cancel";
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
 }
コード例 #3
0
 /**
  * Creates the actual control that will edit the value.
  *
  * @param QControl $objParent
  * @return QIntegerTextBox|QListBox|QRadioButtonList|QTextBox
  */
 protected function CreateControl(QControl $objParent)
 {
     switch ($this->controlType) {
         case QType::Boolean:
             $ctl = new QRadioButtonList($objParent);
             $ctl->AddItem('True', true);
             $ctl->AddItem('False', false);
             $ctl->AddItem('None', null);
             $ctl->RepeatColumns = 3;
             break;
         case QType::String:
             $ctl = new QTextBox($objParent);
             break;
         case QType::Integer:
             $ctl = new QIntegerTextBox($objParent);
             break;
         case QType::ArrayType:
             // an array the user will specify in a comma separated list
             $ctl = new QTextBox($objParent);
             break;
         case QModelConnectorParam::SelectionList:
             // a specific set of choices to present to the user
             $ctl = new QListBox($objParent);
             foreach ($this->options as $key => $val) {
                 $ctl->AddItem($val, $key === '' ? null : $key);
                 // allow null item keys
             }
             break;
         default:
             // i.e. QJsClosure, or other random items. Probably codegened, and not used much.
             $ctl = new QTextBox($objParent);
             break;
     }
     $ctl->Name = $this->strName;
     $ctl->ToolTip = $this->strDescription;
     return $ctl;
 }
コード例 #4
0
ファイル: jq_example.php プロジェクト: tomVertuoz/framework
 protected function Form_Create()
 {
     $this->Draggable = new QPanel($this);
     $this->Draggable->Text = 'Drag me';
     $this->Draggable->CssClass = 'draggable';
     $this->Draggable->Moveable = true;
     //$this->Draggable->AddAction(new QDraggable_StopEvent(), new QJavascriptAction("alert('Dragged to ' + ui.position.top + ',' + ui.position.left)"));
     $this->Draggable->AddAction(new QDraggable_StopEvent(), new QAjaxAction("drag_stop"));
     // Dropable
     $this->Droppable = new QPanel($this);
     $this->Droppable->Text = "Drop here";
     //$this->Droppable->AddAction(new QDroppable_DropEvent(), new QJavascriptAction("alert('Dropped ' + ui.draggable.attr('id'))"));
     $this->Droppable->AddAction(new QDroppable_DropEvent(), new QAjaxAction("droppable_drop"));
     $this->Droppable->CssClass = 'droppable';
     $this->Droppable->Droppable = true;
     // Resizable
     $this->Resizable = new QPanel($this);
     $this->Resizable->CssClass = 'resizable';
     $this->Resizable->Resizable = true;
     $this->Resizable->AddAction(new QResizable_StopEvent(), new QAjaxAction('resizable_stop'));
     // Selectable
     $this->Selectable = new QSelectable($this);
     $this->Selectable->AutoRenderChildren = true;
     $this->Selectable->CssClass = 'selectable';
     for ($i = 1; $i <= 5; ++$i) {
         $pnl = new QPanel($this->Selectable);
         $pnl->Text = 'Item ' . $i;
         $pnl->CssClass = 'selitem';
     }
     $this->Selectable->Filter = 'div.selitem';
     $this->Selectable->SelectedItems = array($pnl->ControlId);
     // pre-select last item
     $this->Selectable->AddAction(new QSelectable_StopEvent(), new QAjaxAction('selectable_stop'));
     // Sortable
     $this->Sortable = new QSortable($this);
     $this->Sortable->AutoRenderChildren = true;
     $this->Sortable->CssClass = 'sortable';
     for ($i = 1; $i <= 5; ++$i) {
         $pnl = new QPanel($this->Sortable);
         $pnl->Text = 'Item ' . $i;
         $pnl->CssClass = 'sortitem';
     }
     $this->Sortable->Items = 'div.sortitem';
     $this->Sortable->AddAction(new QSortable_StopEvent(), new QAjaxAction('sortable_stop'));
     // Accordion
     $this->Accordion = new QAccordion($this);
     $lbl = new QLinkButton($this->Accordion);
     $lbl->Text = 'Header 1';
     $pnl = new QPanel($this->Accordion);
     $pnl->Text = 'Section 1';
     $lbl = new QLinkButton($this->Accordion);
     $lbl->Text = 'Header 2';
     $pnl = new QPanel($this->Accordion);
     $pnl->Text = 'Section 2';
     $lbl = new QLinkButton($this->Accordion);
     $lbl->Text = 'Header 3';
     $pnl = new QPanel($this->Accordion);
     $pnl->Text = 'Section 3';
     $this->Accordion->AddAction(new QChangeEvent(), new QAjaxAction('accordion_change'));
     // Autocomplete
     // Both autocomplete controls below will use the mode
     // "match only on the beginning of the word"
     QAutocomplete::UseFilter(QAutocomplete::FILTER_STARTS_WITH);
     // Client-side only autocomplete
     $this->Autocomplete1 = new QAutocomplete($this);
     $this->Autocomplete1->Source = self::$LANGUAGES;
     $this->Autocomplete1->Name = "Standard Autocomplete";
     $this->Autocomplete2 = new QAutocomplete($this);
     $this->Autocomplete2->Source = self::$LANGUAGES;
     $this->Autocomplete2->AutoFocus = true;
     $this->Autocomplete2->MustMatch = true;
     $this->Autocomplete2->Name = "AutoFocus and MustMatch";
     // Ajax Autocomplete
     // Note: To show the little spinner while the ajax search is happening, you
     // need to define the .ui-autocomplete-loading class in a style sheet. See
     // header.inc.php for an example.
     $this->AjaxAutocomplete = new QAutocomplete($this);
     $this->AjaxAutocomplete->SetDataBinder("update_autocompleteList");
     $this->AjaxAutocomplete->AddAction(new QAutocomplete_ChangeEvent(), new QAjaxAction('ajaxautocomplete_change'));
     $this->AjaxAutocomplete->DisplayHtml = true;
     $this->AjaxAutocomplete->Name = 'With Html Display';
     $this->AjaxAutocomplete2 = new QAutocomplete($this);
     $this->AjaxAutocomplete2->MultipleValueDelimiter = ',';
     $this->AjaxAutocomplete2->SetDataBinder("update_autocompleteList");
     $this->AjaxAutocomplete2->Name = 'Multiple selection';
     // Button
     $this->Button = new QJqButton($this);
     $this->Button->Label = "Click me";
     // Label overrides Text
     $this->Button->AddAction(new QClickEvent(), new QServerAction("button_click"));
     $this->CheckBox = new QJqCheckBox($this);
     $this->CheckBox->Text = "CheckBox";
     $this->RadioButton = new QJqRadioButton($this);
     $this->RadioButton->Text = "RadioButton";
     $this->IconButton = new QJqButton($this);
     $this->IconButton->Text = "Sample";
     $this->IconButton->ShowText = false;
     $this->IconButton->Icons = array("primary" => JqIcon::Lightbulb);
     // Lists
     $this->CheckList1 = new QCheckBoxList($this);
     $this->CheckList1->Name = "CheckBoxList with buttonset";
     foreach (self::$LANGUAGES as $strLang) {
         $this->CheckList1->AddItem($strLang);
     }
     $this->CheckList1->ButtonMode = QCheckBoxList::ButtonModeSet;
     $this->CheckList2 = new QCheckBoxList($this);
     $this->CheckList2->Name = "CheckBoxList with button style";
     foreach (self::$LANGUAGES as $strLang) {
         $this->CheckList2->AddItem($strLang);
     }
     $this->CheckList2->ButtonMode = QCheckBoxList::ButtonModeJq;
     $this->CheckList2->RepeatColumns = 4;
     $this->RadioList1 = new QRadioButtonList($this);
     $this->RadioList1->Name = "RadioButtonList with buttonset";
     foreach (self::$LANGUAGES as $strLang) {
         $this->RadioList1->AddItem($strLang);
     }
     $this->RadioList1->ButtonMode = QCheckBoxList::ButtonModeSet;
     $this->RadioList2 = new QRadioButtonList($this);
     $this->RadioList2->Name = "RadioButtonList with button style";
     foreach (self::$LANGUAGES as $strLang) {
         $this->RadioList2->AddItem($strLang);
     }
     $this->RadioList2->ButtonMode = QCheckBoxList::ButtonModeJq;
     $this->RadioList2->RepeatColumns = 4;
     // Datepicker
     $this->Datepicker = new QDatepicker($this);
     // DatepickerBox
     $this->DatepickerBox = new QDatepickerBox($this);
     // Dialog
     $this->Dialog = new QDialog($this);
     $this->Dialog->Text = 'a non modal dialog';
     $this->Dialog->AddButton('Cancel', 'cancel');
     $this->Dialog->AddButton('OK', 'ok');
     $this->Dialog->AddAction(new QDialog_ButtonEvent(), new QAjaxAction('dialog_press'));
     $this->Dialog->AutoOpen = false;
     $this->btnShowDialog = new QJqButton($this);
     $this->btnShowDialog->Text = 'Show Dialog';
     $this->btnShowDialog->AddAction(new QClickEvent(), new QShowDialog($this->Dialog));
     $this->txtDlgTitle = new QTextBox($this);
     $this->txtDlgTitle->Name = "Set Title To:";
     $this->txtDlgTitle->AddAction(new QKeyPressEvent(10), new QAjaxAction('dlgTitle_Change'));
     $this->txtDlgTitle->AddAction(new QBackspaceKeyEvent(10), new QAjaxAction('dlgTitle_Change'));
     $this->txtDlgText = new QTextBox($this);
     $this->txtDlgText->Name = "Set Text To:";
     $this->txtDlgText->AddAction(new QKeyPressEvent(10), new QAjaxAction('dlgText_Change'));
     $this->txtDlgText->AddAction(new QBackspaceKeyEvent(10), new QAjaxAction('dlgText_Change'));
     // Progressbar
     $this->Progressbar = new QProgressbar($this);
     $this->Progressbar->Value = 37;
     // Slider
     $this->Slider = new QSlider($this);
     $this->Slider->AddAction(new QSlider_SlideEvent(), new QJavascriptAction('jQuery("#' . $this->Progressbar->ControlId . '").progressbar ("value", ui.value)'));
     $this->Slider->AddAction(new QSlider_ChangeEvent(), new QAjaxAction('slider_change'));
     $this->Slider2 = new QSlider($this);
     $this->Slider2->Range = true;
     $this->Slider2->Values = array(10, 50);
     $this->Slider2->AddAction(new QSlider_ChangeEvent(), new QAjaxAction('slider2_change'));
     // Tabs
     $this->Tabs = new QTabs($this);
     $tab1 = new QPanel($this->Tabs);
     $tab1->Text = 'First tab is active by default';
     $tab2 = new QPanel($this->Tabs);
     $tab2->Text = 'Tab 2';
     $tab3 = new QPanel($this->Tabs);
     $tab3->Text = 'Tab 3';
     $this->Tabs->Headers = array('One', 'Two', 'Three');
 }
コード例 #5
0
ファイル: RadioList.php プロジェクト: qcubed/plugin_bootstrap
 public function __set($strName, $mixValue)
 {
     switch ($strName) {
         // APPEARANCE
         case "ButtonStyle":
             try {
                 $this->objItemStyle->RemoveCssClass($this->strButtonStyle);
                 $this->strButtonStyle = \QType::Cast($mixValue, \QType::String);
                 $this->objItemStyle->AddCssClass($this->strButtonStyle);
                 break;
             } catch (\QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "ButtonMode":
             // inherited
             try {
                 if ($mixValue === self::ButtonModeSet) {
                     $this->objItemStyle->SetCssClass("btn");
                     $this->objItemStyle->AddCssClass($this->strButtonStyle);
                     parent::__set($strName, $mixValue);
                     break;
                 }
             } catch (\QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         default:
             try {
                 parent::__set($strName, $mixValue);
                 break;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
コード例 #6
0
ファイル: edit.php プロジェクト: alcf/chms
 protected function Form_Create()
 {
     // Load and validate the Staff Person we're trying to view
     $this->objLogin = Login::Load(QApplication::PathInfo(0));
     if (!$this->objLogin) {
         QApplication::Redirect('/admin/users');
     }
     $this->strPageTitle .= $this->objLogin->Name;
     // Display: Username
     $this->lblUsername = new QLabel($this);
     $this->lblUsername->Name = 'Username';
     $this->lblUsername->Text = $this->objLogin->Username;
     // Display: Email
     $this->lblEmail = new QLabel($this);
     $this->lblEmail->Name = 'Email';
     if ($this->objLogin->Email) {
         $this->lblEmail->Text = $this->objLogin->Email;
     } else {
         $this->lblEmail->Text = 'none';
         $this->lblEmail->CssClass = 'na';
     }
     // Display Ministry Involvement Information
     $this->lblMinistries = new QLabel($this);
     $this->lblMinistries->Name = 'Ministry Involvement';
     $strArray = array();
     foreach ($this->objLogin->GetMinistryArray() as $objMinistry) {
         $strArray[] = QApplication::HtmlEntities($objMinistry->Name);
     }
     $this->lblMinistries->Text = implode(' &nbsp;&bull;&nbsp; ', $strArray);
     if (!$this->lblMinistries->Text) {
         $this->lblMinistries->CssClass = 'na';
         $this->lblMinistries->Text = 'n/a';
     }
     $this->lblMinistries->HtmlEntities = false;
     foreach (Ministry::LoadAll(QQ::OrderBy(QQN::Ministry()->Name)) as $objMinistry) {
         $rblMinistry = new QRadioButtonList($this);
         $rblMinistry->Name = $objMinistry->Name;
         if (in_array($objMinistry->Name, $strArray)) {
             $rblMinistry->AddItem('Yes', $objMinistry->Id, true);
             $rblMinistry->AddItem('No', 0, false);
         } else {
             $rblMinistry->AddItem('Yes', $objMinistry->Id, false);
             $rblMinistry->AddItem('No', 0, true);
         }
         $rblMinistry->RepeatColumns = 2;
         $this->rblMinistryArray[] = $rblMinistry;
     }
     foreach (PermissionType::$NameArray as $intId => $strName) {
         $rblPermission = new QRadioButtonList($this);
         $rblPermission->Name = 'Can ' . $strName;
         $rblPermission->AddItem('Yes', $intId, $this->objLogin->IsPermissionAllowed($intId));
         $rblPermission->AddItem('No', 0, !$this->objLogin->IsPermissionAllowed($intId));
         $rblPermission->RepeatColumns = 2;
         $this->rblPermissionArray[] = $rblPermission;
     }
     $this->lblRoleType = new QLabel($this);
     $this->lblRoleType->Name = 'Role';
     $this->lblRoleType->Text = "Volunteer";
     //not going to let this change to anything different
     $this->lblDomainActive = new QLabel($this);
     $this->lblDomainActive->Name = 'Domain Account Active';
     $this->lblDomainActive->Text = $this->objLogin->DomainActiveFlag ? 'Yes' : 'No';
     $this->rblLoginActive = new QRadioButtonList($this);
     $this->rblLoginActive->Name = 'ChMS Login Enabled';
     $this->rblLoginActive->AddItem('Yes', true, $this->objLogin->LoginActiveFlag);
     $this->rblLoginActive->AddItem('No', false, !$this->objLogin->LoginActiveFlag);
     $this->rblLoginActive->RepeatColumns = 2;
     $this->lblDateLastLogin = new QLabel($this);
     $this->lblDateLastLogin->Name = 'Date of Last ChMS Access';
     if ($this->objLogin->DateLastLogin) {
         $this->lblDateLastLogin->Text = $this->objLogin->DateLastLogin->ToString('MMMM D YYYY') . ' at ' . $this->objLogin->DateLastLogin->ToString('h:mmz');
     } else {
         $this->lblDateLastLogin->Text = 'None';
         $this->lblDateLastLogin->CssClass = 'na';
     }
     // Add controls and stuff for Editable pages
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = 'Update';
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
     $this->btnSave->CssClass = 'primary';
     $this->strPassword = new QTextBox($this);
     $this->strPassword->Name = "Reset Password";
     $this->strConfirmPassword = new QTextBox($this);
     $this->strConfirmPassword->Name = "Confirm Password";
     $this->lblMessage = new QLabel($this);
     $this->btnCancel = new QLinkButton($this);
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
     $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
     $this->btnCancel->CssClass = 'cancel';
 }
コード例 #7
0
ファイル: SignupQForm.class.php プロジェクト: alcf/chms
 /**
  * Creates all the controls for each "question" in the form.
  * Note: For any fields that are looked up from the user's profile (e.g. address, phone, etc.) -- a drop down is available for quick access.
  * However, if they select "other", we save the data and do NOT link it to any records!
  * (e.g. if an "other" phone is used, that data is not stored anywhere else)
  */
 protected function CreateFormItemControls()
 {
     /**
      * @var Person
      */
     $objPerson = $this->objSignupEntry->Person;
     if ($objPerson != null) {
         // First, set up for the Person Name label
         $lblPersonName = new QLabel($this, 'lblPersonName');
         $lblPersonName->Name = 'Name';
         $lblPersonName->Required = true;
         $lblPersonName->Text = $objPerson->Name;
         $lblPersonName->RenderMethod = 'RenderWithName';
         $this->objFormQuestionControlArray[] = $lblPersonName;
     } else {
         // else if not logged in, prompt for First and Last Name. Always.
         $txtFirstName = new QTextBox($this);
         $txtFirstName->Name = 'First Name';
         $txtFirstName->Required = true;
         $txtFirstName->RenderMethod = 'RenderWithName';
         $this->objFormQuestionControlArray[] = $txtFirstName;
         $txtLastName = new QTextBox($this);
         $txtLastName->Name = 'Last Name';
         $txtLastName->Required = true;
         $txtLastName->RenderMethod = 'RenderWithName';
         $this->objFormQuestionControlArray[] = $txtLastName;
     }
     // Go through all the other fields
     foreach ($this->objSignupForm->GetFormQuestionArray(QQ::OrderBy(QQN::FormQuestion()->OrderNumber)) as $objFormQuestion) {
         // Only display if this is NOT "InternalFlag"
         if ($objFormQuestion->InternalFlag) {
             continue;
         }
         $strControlId = 'fq' . $objFormQuestion->Id;
         $objFormAnswer = FormAnswer::LoadBySignupEntryIdFormQuestionId($this->objSignupEntry->Id, $objFormQuestion->Id);
         switch ($objFormQuestion->FormQuestionTypeId) {
             case FormQuestionType::SpouseName:
                 if ($objPerson != null) {
                     if (($objMarriage = $objPerson->GetMostRecentMarriage()) && $objMarriage->MarriedToPerson) {
                         $lstSpouse = new QListBox($this, $strControlId . 'id');
                         $lstSpouse->ActionParameter = $strControlId . 'nm';
                         if (!$objFormQuestion->RequiredFlag) {
                             $lstSpouse->AddItem('- Select One -', null);
                         }
                         $lstSpouse->AddItem($objMarriage->MarriedToPerson->Name, $objMarriage->MarriedToPerson->Id, true);
                         $lstSpouse->AddItem('- Other... -', false);
                         $lstSpouse->AddAction(new QChangeEvent(), new QAjaxAction('lst_ToggleOther'));
                         $lstSpouse->Name = $objFormQuestion->Question;
                         if ($objFormQuestion->RequiredFlag) {
                             $lstSpouse->Required = true;
                         }
                         $lstSpouse->RenderMethod = 'RenderWithName';
                         $this->objFormQuestionControlArray[] = $lstSpouse;
                         $txtName = new QTextBox($this, $strControlId . 'nm');
                         $txtName->RenderMethod = 'RenderWithName';
                         $this->objFormQuestionControlArray[] = $txtName;
                         $txtName->Visible = false;
                         $txtName->Required = false;
                         if ($objFormAnswer && strlen($objFormAnswer->TextValue)) {
                             if ($lstSpouse->SelectedName != $objFormAnswer->TextValue) {
                                 $lstSpouse->SelectedIndex = count($lstSpouse->GetAllItems()) - 1;
                                 $txtName->Text = $objFormAnswer->TextValue;
                                 $this->lst_ToggleOther(null, $lstSpouse->ControlId, $lstSpouse->ActionParameter);
                             }
                         }
                     } else {
                         $lstSpouse = new QListBox($this, $strControlId . 'id');
                         $lstSpouse->Visible = false;
                         if ($objFormQuestion->RequiredFlag) {
                             $lstSpouse->Required = true;
                         }
                         $lstSpouse->RenderMethod = 'RenderWithName';
                         $this->objFormQuestionControlArray[] = $lstSpouse;
                         $txtName = new QTextBox($this, $strControlId . 'nm');
                         $txtName->Name = $objFormQuestion->Question;
                         $txtName->RenderMethod = 'RenderWithName';
                         $this->objFormQuestionControlArray[] = $txtName;
                         $txtName->Visible = true;
                         $txtName->Required = $objFormQuestion->RequiredFlag;
                         if ($objFormAnswer && strlen($objFormAnswer->TextValue)) {
                             $txtName->Text = $objFormAnswer->TextValue;
                         }
                     }
                 } else {
                     $txtName = new QTextBox($this, $strControlId . 'nm');
                     $txtName->Name = $objFormQuestion->Question;
                     $txtName->RenderMethod = 'RenderWithName';
                     $this->objFormQuestionControlArray[] = $txtName;
                     $txtName->Visible = true;
                     $txtName->Required = $objFormQuestion->RequiredFlag;
                     if ($objFormAnswer && strlen($objFormAnswer->TextValue)) {
                         $txtName->Text = $objFormAnswer->TextValue;
                     }
                 }
                 break;
             case FormQuestionType::Address:
                 if ($objPerson != null) {
                     $objHouseholdArray = Household::LoadArrayBySharedHouseholds($objPerson, $this->objSignupEntry->SignupByPerson);
                     if (count($objHouseholdArray) > 1) {
                         // TODO: Implement!
                         throw new Exception('TODO: Not Implemented');
                     } else {
                         if (count($objHouseholdArray) == 1) {
                             $objAddress = $objHouseholdArray[0]->GetCurrentAddress();
                             $rblAddress = new QRadioButtonList($this, $strControlId . 'switch');
                             $rblAddress->Name = $objFormQuestion->Question;
                             $rblAddress->RenderMethod = 'RenderWithName';
                             $rblAddress->AddItem('Use Home Address Below', $objAddress->Id, true);
                             $rblAddress->AddItem('Edit Home Address', false, false);
                             $rblAddress->RepeatColumns = 2;
                             $rblAddress->AddAction(new QClickEvent(), new QAjaxAction('rblAddress_Change'));
                             $this->objFormQuestionControlArray[] = $rblAddress;
                         } else {
                             $objAddress = new Address();
                             $rblAddress = null;
                         }
                     }
                 }
                 $txtAddress1 = new QTextBox($this, $strControlId . 'address1');
                 $txtAddress1->Name = 'Address 1';
                 $txtAddress1->RenderMethod = 'RenderWithName';
                 $txtAddress1->Text = $objPerson != null ? $objAddress->Address1 : '';
                 $txtAddress2 = new QTextBox($this, $strControlId . 'address2');
                 $txtAddress2->Name = 'Address 2';
                 $txtAddress2->RenderMethod = 'RenderWithName';
                 $txtAddress2->Text = $objPerson != null ? $objAddress->Address2 : '';
                 $txtCity = new QTextBox($this, $strControlId . 'city');
                 $txtCity->Name = 'City, State and Zip';
                 $txtCity->RenderMethod = 'RenderWithName';
                 $txtCity->Text = $objPerson != null ? $objAddress->City : '';
                 $lstState = new QListBox($this, $strControlId . 'state');
                 $lstState->ActionParameter = '_' . $strControlId . 'city';
                 $lstState->Name = QApplication::Translate('State');
                 $lstState->RenderMethod = 'RenderWithError';
                 $lstState->AddItem(QApplication::Translate('- Select One -'), null);
                 foreach (UsState::LoadAll(QQ::OrderBy(QQN::UsState()->Name)) as $objUsState) {
                     if ($objPerson != null) {
                         $lstState->AddItem($objUsState->Name, $objUsState->Abbreviation, $objAddress->State == $objUsState->Abbreviation);
                     } else {
                         $lstState->AddItem($objUsState->Name, $objUsState->Abbreviation, false);
                     }
                 }
                 $txtZipCode = new QTextBox($this, $strControlId . 'zipcode');
                 $txtZipCode->ActionParameter = '_' . $strControlId . 'city';
                 $txtZipCode->Name = 'Zip Code';
                 $txtZipCode->RenderMethod = 'RenderWithError';
                 $txtZipCode->Text = $objPerson != null ? $objAddress->ZipCode : '';
                 $txtZipCode->Width = '80px';
                 if ($objFormQuestion->RequiredFlag) {
                     $txtAddress1->Required = true;
                     $txtCity->Required = true;
                     $lstState->Required = true;
                     $txtZipCode->Required = true;
                 }
                 $this->objFormQuestionControlArray[] = $txtAddress1;
                 $this->objFormQuestionControlArray[] = $txtAddress2;
                 $this->objFormQuestionControlArray[] = $txtCity;
                 $this->objFormQuestionControlArray[] = $lstState;
                 $this->objFormQuestionControlArray[] = $txtZipCode;
                 // Final configuration based on whether or not we've got a household record for this person
                 // (in which case we have defined a rblAddress)
                 if ($objPerson != null) {
                     if ($rblAddress) {
                         // Check to see if the question has been answered before
                         if ($objFormAnswer && strlen($objFormAnswer->TextValue)) {
                             // If it
                             $objAddress = Address::DeduceAddressFromFullLine($objFormAnswer->TextValue);
                             if ($objFormAnswer->AddressId == $rblAddress->SelectedValue || !$objAddress) {
                                 $txtAddress1->Enabled = false;
                                 $txtAddress2->Enabled = false;
                                 $txtCity->Enabled = false;
                                 $lstState->Enabled = false;
                                 $txtZipCode->Enabled = false;
                             } else {
                                 $txtAddress1->Text = $objAddress->Address1;
                                 $txtAddress2->Text = $objAddress->Address2;
                                 $txtCity->Text = $objAddress->City;
                                 $txtZipCode->Text = $objAddress->ZipCode;
                                 $lstState->SelectedValue = $objAddress->State;
                                 $rblAddress->SelectedIndex = 1;
                             }
                             // It has not -- let's default to having the address be presumed correct
                         } else {
                             $txtAddress1->Enabled = false;
                             $txtAddress2->Enabled = false;
                             $txtCity->Enabled = false;
                             $lstState->Enabled = false;
                             $txtZipCode->Enabled = false;
                         }
                         // No rblAddress - so let's update the address1 label to match the form question's question text
                     } else {
                         $txtAddress1->Name = $objFormQuestion->Question;
                     }
                 }
                 break;
             case FormQuestionType::Age:
                 $txtAge = new QIntegerTextBox($this, $strControlId . 'age');
                 $txtAge->Name = $objFormQuestion->Question;
                 $txtAge->Minimum = 0;
                 $txtAge->Maximum = 130;
                 $txtAge->MaxLength = 3;
                 if ($objFormAnswer && !is_null($objFormAnswer->IntegerValue)) {
                     $txtAge->Text = $objFormAnswer->IntegerValue;
                 } else {
                     if ($objPerson != null) {
                         if (!$objPerson->DobYearApproximateFlag && $objPerson->Age) {
                             $txtAge->Text = $objPerson->Age;
                         }
                     }
                 }
                 if ($objFormQuestion->RequiredFlag) {
                     $txtAge->Required = true;
                 }
                 $txtAge->RenderMethod = 'RenderWithName';
                 $this->objFormQuestionControlArray[] = $txtAge;
                 $txtAge->Width = '50px';
                 break;
             case FormQuestionType::DateofBirth:
                 $dtxDateOfBirth = new QDateTimeTextBox($this, $strControlId . 'dob');
                 $dtxDateOfBirth->LabelForInvalid = 'For example, "Mar 20 1977"';
                 $dtxDateOfBirth->Name = $objFormQuestion->Question;
                 if ($objFormAnswer && !is_null($objFormAnswer->DateValue)) {
                     $dtxDateOfBirth->Text = $objFormAnswer->DateValue->ToString('MMM D YYYY');
                 } else {
                     if ($objPerson != null) {
                         if (!$objPerson->DobYearApproximateFlag && !$objPerson->DobGuessedFlag && $objPerson->DateOfBirth) {
                             $dtxDateOfBirth->Text = $objPerson->DateOfBirth->ToString('MMM D YYYY');
                         }
                     }
                 }
                 if ($objFormQuestion->RequiredFlag) {
                     $dtxDateOfBirth->Required = true;
                 }
                 $dtxDateOfBirth->RenderMethod = 'RenderWithName';
                 $this->objFormQuestionControlArray[] = $dtxDateOfBirth;
                 $dtxDateOfBirth->Width = '150px';
                 break;
             case FormQuestionType::Gender:
                 $lstGender = new QListBox($this, $strControlId . 'gender');
                 $lstGender->Name = $objFormQuestion->Question;
                 $lstGender->AddItem('- Select One -', null);
                 if ($objFormAnswer && $objFormAnswer->TextValue) {
                     $lstGender->AddItem('Male', true, $objFormAnswer->BooleanValue);
                     $lstGender->AddItem('Female', false, !$objFormAnswer->BooleanValue);
                 } else {
                     if ($objPerson != null) {
                         $lstGender->AddItem('Male', true, $objPerson->Gender == 'M');
                         $lstGender->AddItem('Female', false, $objPerson->Gender == 'F');
                     } else {
                         $lstGender->AddItem('Male', true, true);
                         // just default to something
                         $lstGender->AddItem('Female', false, false);
                     }
                 }
                 if ($objFormQuestion->RequiredFlag) {
                     $lstGender->Required = true;
                 }
                 $lstGender->RenderMethod = 'RenderWithName';
                 $this->objFormQuestionControlArray[] = $lstGender;
                 break;
             case FormQuestionType::Phone:
                 $objPhoneArray = array();
                 if ($objPerson != null) {
                     // Add Household Numbers (if applicable)
                     foreach ($objPerson->GetHouseholdParticipationArray() as $objHouseholdParticipation) {
                         foreach ($objHouseholdParticipation->Household->GetCurrentAddress()->GetPhoneArray() as $objPhone) {
                             $objPhoneArray[] = $objPhone;
                         }
                     }
                     // Add Personal Numbers
                     foreach ($objPerson->GetPhoneArray() as $objPhone) {
                         $objPhoneArray[] = $objPhone;
                     }
                     if (count($objPhoneArray)) {
                         $lstPhone = new QListBox($this, $strControlId . 'id');
                         $lstPhone->ActionParameter = $strControlId . 'phone';
                         $lstPhone->Name = $objFormQuestion->Question;
                         $lstPhone->AddItem('- Select One -', null);
                         rsort($objPhoneArray);
                         foreach ($objPhoneArray as $objPhone) {
                             $lstPhone->AddItem($objPhone->Number, $objPhone->Id, $objFormAnswer && $objFormAnswer->PhoneId == $objPhone->Id);
                         }
                         $lstPhone->AddItem('- Other... -', false);
                         if ($objFormQuestion->RequiredFlag) {
                             $lstPhone->Required = true;
                         }
                         $lstPhone->RenderMethod = 'RenderWithName';
                         $this->objFormQuestionControlArray[] = $lstPhone;
                         $lstPhone->AddAction(new QChangeEvent(), new QAjaxAction('lst_ToggleOther'));
                     }
                 }
                 $txtPhone = new PhoneTextBox($this, $strControlId . 'phone');
                 $this->objFormQuestionControlArray[] = $txtPhone;
                 $txtPhone->RenderMethod = 'RenderWithName';
                 // We need to deduce whether or not we should show an explicit text-valued phone number from before
                 if ($objPerson != null) {
                     $blnExplicitlyTextValueOnly = $objFormAnswer && $objFormAnswer->TextValue && (!$lstPhone || !$lstPhone->SelectedValue);
                 } else {
                     $blnExplicitlyTextValueOnly = true;
                 }
                 if (count($objPhoneArray)) {
                     if ($blnExplicitlyTextValueOnly) {
                         $lstPhone->SelectedIndex = count($lstPhone->GetAllItems()) - 1;
                         $txtPhone->Visible = true;
                         $txtPhone->Required = $objFormQuestion->RequiredFlag;
                         $txtPhone->Text = $objFormAnswer->TextValue;
                     } else {
                         $txtPhone->Visible = false;
                         $txtPhone->Required = false;
                     }
                 } else {
                     $txtPhone->Visible = true;
                     $txtPhone->Required = $objFormQuestion->RequiredFlag;
                     $txtPhone->Name = $objFormQuestion->Question;
                     if ($blnExplicitlyTextValueOnly) {
                         $txtPhone->Text = $objFormAnswer ? $objFormAnswer->TextValue : '';
                     }
                 }
                 break;
             case FormQuestionType::Email:
                 $objEmailArray = array();
                 if ($objPerson != null) {
                     // Add Personal Emails
                     foreach ($objPerson->GetEmailArray() as $objEmail) {
                         $objEmailArray[] = $objEmail;
                     }
                     if (count($objEmailArray)) {
                         $lstEmail = new QListBox($this, $strControlId . 'id');
                         $lstEmail->ActionParameter = $strControlId . 'email';
                         $lstEmail->Name = $objFormQuestion->Question;
                         $lstEmail->AddItem('- Select One -', null);
                         rsort($objEmailArray);
                         foreach ($objEmailArray as $objEmail) {
                             $lstEmail->AddItem($objEmail->Address, $objEmail->Id, $objFormAnswer && $objFormAnswer->EmailId == $objEmail->Id);
                         }
                         $lstEmail->AddItem('- Other... -', false);
                         if ($objFormQuestion->RequiredFlag) {
                             $lstEmail->Required = true;
                         }
                         $lstEmail->RenderMethod = 'RenderWithName';
                         $this->objFormQuestionControlArray[] = $lstEmail;
                         $lstEmail->AddAction(new QChangeEvent(), new QAjaxAction('lst_ToggleOther'));
                     }
                 }
                 $txtEmail = new QEmailTextBox($this, $strControlId . 'email');
                 $this->strEmailCtrlId = $strControlId . 'email';
                 $this->objFormQuestionControlArray[] = $txtEmail;
                 $txtEmail->RenderMethod = 'RenderWithName';
                 // We need to deduce whether or not we should show an explicit text-valued email address from before
                 if ($objPerson != null) {
                     $blnExplicitlyTextValueOnly = $objFormAnswer && $objFormAnswer->TextValue && (!$lstEmail || !$lstEmail->SelectedValue);
                 } else {
                     $blnExplicitlyTextValueOnly = true;
                 }
                 if (count($objEmailArray)) {
                     if ($blnExplicitlyTextValueOnly) {
                         $lstEmail->SelectedIndex = count($lstEmail->GetAllItems()) - 1;
                         $txtEmail->Visible = true;
                         $txtEmail->Required = $objFormQuestion->RequiredFlag;
                         $txtEmail->Text = $objFormAnswer->TextValue;
                     } else {
                         $txtEmail->Visible = false;
                         $txtEmail->Required = false;
                     }
                 } else {
                     $txtEmail->Visible = true;
                     $txtEmail->Required = $objFormQuestion->RequiredFlag;
                     $txtEmail->Name = $objFormQuestion->Question;
                     if ($blnExplicitlyTextValueOnly) {
                         $txtEmail->Text = $objFormAnswer ? $objFormAnswer->TextValue : '';
                     }
                 }
                 break;
             case FormQuestionType::ShortText:
                 $txtAnswer = new QTextBox($this, $strControlId);
                 $txtAnswer->Name = $objFormQuestion->Question;
                 $txtAnswer->Required = $objFormQuestion->RequiredFlag;
                 $txtAnswer->RenderMethod = 'RenderWithName';
                 $this->objFormQuestionControlArray[] = $txtAnswer;
                 if ($objFormAnswer) {
                     $txtAnswer->Text = $objFormAnswer->TextValue;
                 }
                 break;
             case FormQuestionType::LongText:
                 $txtAnswer = new QTextBox($this, $strControlId);
                 $txtAnswer->Name = $objFormQuestion->Question;
                 $txtAnswer->Required = $objFormQuestion->RequiredFlag;
                 $txtAnswer->RenderMethod = 'RenderWithName';
                 $txtAnswer->TextMode = QTextMode::MultiLine;
                 $this->objFormQuestionControlArray[] = $txtAnswer;
                 if ($objFormAnswer) {
                     $txtAnswer->Text = $objFormAnswer->TextValue;
                 }
                 break;
             case FormQuestionType::Number:
                 $txtAnswer = new QIntegerTextBox($this, $strControlId);
                 $txtAnswer->Name = $objFormQuestion->Question;
                 $txtAnswer->Required = $objFormQuestion->RequiredFlag;
                 $txtAnswer->RenderMethod = 'RenderWithName';
                 $this->objFormQuestionControlArray[] = $txtAnswer;
                 $txtAnswer->Width = '50px';
                 $txtAnswer->MaxLength = 6;
                 if ($objFormAnswer) {
                     $txtAnswer->Text = $objFormAnswer->IntegerValue;
                 }
                 break;
             case FormQuestionType::YesNo:
                 $chkAnswer = new QCheckBox($this, $strControlId);
                 $chkAnswer->Name = $objFormQuestion->Question;
                 $chkAnswer->Text = trim($objFormQuestion->Options);
                 $chkAnswer->Required = $objFormQuestion->RequiredFlag;
                 $chkAnswer->RenderMethod = 'RenderWithName';
                 $this->objFormQuestionControlArray[] = $chkAnswer;
                 if ($objFormAnswer) {
                     $chkAnswer->Checked = $objFormAnswer->BooleanValue;
                 }
                 break;
             case FormQuestionType::SingleSelect:
                 $lstAnswer = new QListBox($this, $strControlId);
                 $lstAnswer->Name = $objFormQuestion->Question;
                 $lstAnswer->Required = $objFormQuestion->RequiredFlag;
                 $lstAnswer->RenderMethod = 'RenderWithName';
                 $this->objFormQuestionControlArray[] = $lstAnswer;
                 $lstAnswer->AddItem('- Select One -', null);
                 foreach (explode("\n", trim($objFormQuestion->Options)) as $strItem) {
                     if (strlen($strItem = trim($strItem))) {
                         $lstAnswer->AddItem($strItem, $strItem, $objFormAnswer && $objFormAnswer->TextValue == $strItem);
                     }
                 }
                 if ($objFormQuestion->AllowOtherFlag) {
                     $lstAnswer->ActionParameter = $strControlId . 'other';
                     $lstAnswer->AddAction(new QChangeEvent(), new QAjaxAction('lst_ToggleOther'));
                     $lstAnswer->AddItem('- Other... -', false);
                     $txtAnswer = new QTextBox($this, $strControlId . 'other');
                     $txtAnswer->RenderMethod = 'RenderWithName';
                     $txtAnswer->Required = false;
                     $txtAnswer->Visible = false;
                     $this->objFormQuestionControlArray[] = $txtAnswer;
                 }
                 if ($objFormAnswer && strlen($objFormAnswer->TextValue) && !$lstAnswer->SelectedValue) {
                     if ($objFormQuestion->AllowOtherFlag) {
                         $lstAnswer->SelectedIndex = count($lstAnswer->GetAllItems()) - 1;
                         $txtAnswer->Text = $objFormAnswer->TextValue;
                         $txtAnswer->Visible = true;
                     } else {
                         $lstAnswer->AddItem($objFormAnswer->TextValue, $objFormAnswer->TextValue, true);
                     }
                 }
                 break;
             case FormQuestionType::MultipleSelect:
                 $strAnswerArray = array();
                 if ($objFormAnswer) {
                     foreach (explode("\n", trim($objFormAnswer->TextValue)) as $strAnswer) {
                         if (strlen($strAnswer = trim($strAnswer))) {
                             $strAnswerArray[$strAnswer] = $strAnswer;
                         }
                     }
                 }
                 // GJS - Change to check boxes instead of multi select
                 $chkAnswer = new QCheckBoxList($this, $strControlId);
                 $chkAnswer->Name = $objFormQuestion->Question;
                 $chkAnswer->RenderMethod = 'RenderWithName';
                 $this->objFormQuestionControlArray[] = $chkAnswer;
                 foreach (explode("\n", trim($objFormQuestion->Options)) as $strItem) {
                     if (strlen($strItem = trim($strItem))) {
                         $chkAnswer->AddItem($strItem, $strItem, array_key_exists($strItem, $strAnswerArray));
                         $strAnswerArray[$strItem] = null;
                         unset($strAnswerArray[$strItem]);
                     }
                 }
                 foreach ($strAnswerArray as $strAnswer) {
                     $chkAnswer->AddItem($strAnswer, $strAnswer, true);
                 }
                 if ($objFormQuestion->AllowOtherFlag) {
                     $txtAnswer = new QTextBox($this, $strControlId . 'other');
                     $txtAnswer->RenderMethod = 'RenderWithName';
                     $txtAnswer->HtmlBefore = 'Add another option and hit <strong>Enter</strong>:<br/>';
                     $txtAnswer->Visible = true;
                     $txtAnswer->ActionParameter = $strControlId;
                     $txtAnswer->AddAction(new QEnterKeyEvent(), new QAjaxAction('txtMultipleSelectOther_Enter'));
                     $this->objFormQuestionControlArray[] = $txtAnswer;
                 }
                 break;
             case FormQuestionType::Instructions:
                 $lblAnswer = new QLabel($this, $strControlId);
                 $lblAnswer->HtmlEntities = false;
                 $lblAnswer->Text = nl2br(QApplication::HtmlEntities(trim($objFormQuestion->Options)), true);
                 if (strlen($strLabel = trim($objFormQuestion->Question))) {
                     $lblAnswer->Name = $strLabel;
                     $lblAnswer->RenderMethod = 'RenderWithName';
                 } else {
                     $lblAnswer->RenderMethod = 'Render';
                 }
                 $this->objFormQuestionControlArray[] = $lblAnswer;
                 break;
             default:
                 throw new Exception('Invalid FormQuestionTypeId: ' . $objFormQuestion->FormQuestionTypeId);
         }
     }
 }