3.2.0

Combo boxes not closing in Firefox

Hi all. I'm having a problem with Combo boxes. I use AW.Templates.Combo as the template for grid cells; I added some custom code to allow them to open and close when you click anywhere in the box, instead of just on the arrow. This seems to work ok in both IE and Firefox. However, I still have a problem: when I click outside the dropdown list, it doesn't close. This only happens in Firefox, not IE. (I'm using Firefox 2.0.0.12)

I already saw this thread: http://www.activewidgets.com/javascript.forum.13299.10/fix-combo-template-not-closing.html, which mentions a patch for AW 2.0.0. However, I'm using AW 2.5.1, and I'm still having this problem. Can anyone help me with this, please?

Here is some sample code.

var combo = new AW.Templates.Combo;
grid.setCellTemplate(combo, 3);

for (var row = 0; row < grid.getRowCount(); row++)
{
    grid.getCellTemplate(3, row).setAttribute("expanded", false);
}

grid.onCellClicked =
    function(event, col, row)
    {
        if (col == 3)
        {
            var cellTemplate = this.getCellTemplate(col, row);
            if ((cellTemplate.getAttribute("expanded") == null) ||
                (cellTemplate.getAttribute("expanded") == false))
            {
                cellTemplate.setAttribute("expanded", true);
                cellTemplate.showPopup();
            }
            else
            {
                cellTemplate.hidePopup();
                cellTemplate.setAttribute("expanded", false);
            }    
        }
        return true;
    };


grid.setPopupTemplate(
    function(col, row)
    {
        var grid = this;
        var list = new AW.UI.List;
        list.setSelectionMode('single');
        
        list.setItemValue(myValues[row]);
        list.setItemText(myNames[row]);
        list.setItemCount(myValues[row].length);
        list.setSelectedItems([selectedRows[row]]);
        list.setControlText(myNames[row][selectedRows[row]]);
        
        list.onItemClicked = 
            function(event, i)
            {
                this.setSelectedItems([i]);
                var value = this.getItemValue(i);
                var text = this.getItemText(i);
                grid.setCellValue(value, col, row);
                grid.setCellText(text, col, row);
                grid.getCellTemplate(col, row).hidePopup();
                grid.getCellTemplate(col, row).setAttribute("expanded", false);
                selectedRows[row] = i;
                
                selectRow(row, (row+1));
            };

        if (row % 2 == 1)
        {
            list.setStyle("background-color", "<%=alternateColor%>");
        }
        list.setStyle("width", "100%");
                
        return list;
    });
Jared
February 20,

This topic is archived.

See also:


Back to support forum