public function __construct(QForm $objForm, $strGroupingId) { if (strlen($strGroupingId) == 0) $this->strGroupingId = $objForm->GenerateControlId(); else { // Verify ControlId is only AlphaNumeric Characters $strMatches = array(); $strPattern = '/[A-Za-z0-9]*/'; preg_match($strPattern, $strGroupingId, $strMatches); if (count($strMatches) && ($strMatches[0] == $strGroupingId)) $this->strGroupingId = $strGroupingId; else throw new QCallerException('GroupingIDs must be only alphanumeric chacters: ' . $strGroupingId); } try { $objForm->AddGrouping($this); } catch (QCallerException $objExc) { $objExc->IncrementOffset(); throw $objExc; } }