Inheritance: extends QControl
Example #1
0
File: remove.php Project: alcf/chms
 public function RenderRadio(HouseholdParticipation $objParticipation)
 {
     if ($objParticipation->Household->HeadPersonId == $objParticipation->PersonId) {
         // Do Nothing
         return ' ';
     } else {
         $radSelect = new QRadioButton($this->dtgMembers);
         $radSelect->GroupName = 'select';
         $radSelect->ActionParameter = $objParticipation->Id;
         $this->radSelectArray[] = $radSelect;
         return $radSelect->Render(false);
     }
 }
 public function RenderSelectButton(Person $objPerson)
 {
     $strControlId = 'SelectPersonBtn' . $objPerson->Id;
     $rbtnSelected = $this->objForm->GetControl($strControlId);
     if (!$rbtnSelected) {
         $rbtnSelected = new QRadioButton($this->dtgPerson, $strControlId);
         $rbtnSelected->Text = '';
         $rbtnSelected->ActionParameter = $objPerson->Id;
         $rbtnSelected->Checked = false;
         $rbtnSelected->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'SelectButton_Clicked'));
         $this->rbtnSelectArray[] = $rbtnSelected;
     }
     return $rbtnSelected->Render(false);
 }
Example #3
0
 public function RenderHead(HouseholdParticipation $objParticipation)
 {
     $strControlId = 'radHead' . $objParticipation->Id;
     if (!($radHead = $this->GetControl($strControlId))) {
         $radHead = new QRadioButton($this->dtgMembers, $strControlId);
         $radHead->GroupName = 'head';
         $radHead->Checked = $this->objHousehold->HeadPersonId == $objParticipation->PersonId;
         $radHead->ActionParameter = $objParticipation->Id;
         $radHead->AddAction(new QClickEvent(), new QAjaxAction('radHead_Click'));
     }
     if ($radHead->Checked) {
         $this->strSelectedRadControlId = $radHead->ControlId;
     }
     return $radHead->Render(false);
 }
Example #4
0
File: merge.php Project: alcf/chms
 public function RenderRadio(Household $objHousehold)
 {
     $radSelect = new QRadioButton($this->dtgHouseholds);
     $radSelect->ActionParameter = $objHousehold->Id;
     $radSelect->GroupName = 'select';
     $radSelect->AddAction(new QClickEvent(), new QAjaxAction('radSelect_Click'));
     $this->radSelectArray[] = $radSelect;
     return $radSelect->Render(false);
 }
 public function __set($strName, $mixValue)
 {
     switch ($strName) {
         case 'Disabled':
             try {
                 $this->blnDisabled = QType::Cast($mixValue, QType::Boolean);
                 if ($this->OnPage) {
                     $this->CallJqUiMethod(true, 'option', 'disabled', $this->blnDisabled);
                 }
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Icons':
             $this->mixIcons = $mixValue;
             if ($this->OnPage) {
                 $this->CallJqUiMethod(true, 'option', 'icons', $mixValue);
             }
             break;
         case 'Label':
             try {
                 $this->strLabel = QType::Cast($mixValue, QType::String);
                 if ($this->OnPage) {
                     $this->CallJqUiMethod(true, 'option', 'label', $this->strLabel);
                 }
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'JqText':
             try {
                 $this->blnJqText = QType::Cast($mixValue, QType::Boolean);
                 if ($this->OnPage) {
                     $this->CallJqUiMethod(true, 'option', 'text', $this->blnJqText);
                 }
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Enabled':
             $this->Disabled = !$mixValue;
             // Tie in standard QCubed functionality
             parent::__set($strName, $mixValue);
             break;
         default:
             try {
                 parent::__set($strName, $mixValue);
                 break;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
Example #6
0
 public function RenderSelect(Person $objPerson)
 {
     $radSelectPerson = new QRadioButton($this->dtgResults);
     $radSelectPerson->GroupName = 'selectPerson';
     $radSelectPerson->ActionParameter = $objPerson->Id;
     $radSelectPerson->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'radSelectPerson_Click'));
     return $radSelectPerson->Render(false);
 }
 /**
  * If this control is attachable to a codegenerated control in a ModelConnector, this function will be
  * used by the ModelConnector designer dialog to display a list of options for the control.
  * @return QModelConnectorParam[]
  **/
 public static function GetModelConnectorParams()
 {
     return array_merge(parent::GetModelConnectorParams(), array(new QModelConnectorParam(get_called_class(), 'Disabled', 'Disables the button if set to true.', QType::Boolean), new QModelConnectorParam(get_called_class(), 'Label', 'Text to show in the button. When not specified (null), the elementsHTML content is used, or its value attribute if the element is aninput element of type submit or reset, or the HTML content of theassociated label element if the element is an input of type radio orcheckbox.', QType::String), new QModelConnectorParam(get_called_class(), 'JqText', 'Whether to show the label. When set to false no text will bedisplayed, but the icons option must be enabled, otherwise the textoption will be ignored.', QType::Boolean)));
 }
Example #8
0
<?php

$strTextboxControlId = 'txtPhone' . $_CONTROL->CurrentItemIndex;
$strRadioControlId = 'radPhone' . $_CONTROL->CurrentItemIndex;
if (!($txtPhone = $_FORM->GetControl($strTextboxControlId))) {
    $txtPhone = new PhoneTextBox($_CONTROL, $strTextboxControlId);
    $txtPhone->Text = $_ITEM->Number;
    $txtPhone->Name = 'Phone Number';
    $txtPhone->ActionParameter = $_CONTROL->CurrentItemIndex;
    $radPhone = new QRadioButton($_CONTROL, $strRadioControlId);
    $radPhone->GroupName = 'phone';
    if ($_CONTROL->ParentControl->objDelegate->mctAddress->Address->PrimaryPhoneId && $_CONTROL->ParentControl->objDelegate->mctAddress->Address->PrimaryPhoneId == $_ITEM->Id) {
        $radPhone->Checked = true;
    } else {
        if (!$_CONTROL->ParentControl->objDelegate->mctAddress->Address->PrimaryPhoneId && $_CONTROL->CurrentItemIndex == 0) {
            $radPhone->Checked = true;
        } else {
            $radPhone->Checked = false;
        }
    }
    $radPhone->AddAction(new QClickEvent(), new QAjaxControlAction($_CONTROL, 'Refresh'));
    $radPhone->ActionParameter = $_CONTROL->CurrentItemIndex;
} else {
    $radPhone = $_FORM->GetControl($strRadioControlId);
}
if ($radPhone->Checked) {
    $txtPhone->Name = 'Primary Home Phone';
} else {
    $txtPhone->Name = 'Alternate Home Phone';
}
?>