Ticket #763 (closed defect: fixed)
QListBox with QSelectionMode::Multiple doesn't set type required for js escaping
| Reported by: | banetbi | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.1 |
| Component: | QControls | Version: | 2.0 HEAD |
| Keywords: | Cc: |
Description
When using a QListBox with QSelectionType::Multiple in an AjaxAction? the following javascript error occurs:
strPostValue.replace is not a function /assets/_core/js/qcubed.js Line 196
upon further inspection this happens because qcubed.js is trying to escape the values. qcubed.js is looking for a type of select-multiple which is not being included in the GetAttributes? call of QListBoxBase.class.php
I was able to resolve the issue by overriding the GetAttributes? function with the following in QListBox.class.php
public function GetAttributes?($blnIncludeCustom = true, $blnIncludeAction = true) {
$strToReturn = parent::GetAttributes?($blnIncludeCustom, $blnIncludeAction);
if ($this->intRows)
$strToReturn .= sprintf('size="%s" ', $this->intRows);
if ($this->strSelectionMode == QSelectionMode::Multiple) {
$strToReturn .= 'multiple="multiple" ';
$strToReturn .= 'type="select-multiple" ';
}
return $strToReturn;
}

