3.2.0

AW.Templates.Combo, not displaying list items

I have the following code for AW.Templates.Combo in my grid. The grid starts, and displays initial values in the combo that exist from the datasource, but when I open the combo box to select a new value, there are no values listed.

I have 3 separate combo boxes in my grid, and I thought this would work:

// Set columns as combo box
    obj.setCellTemplate(new AW.Templates.Combo, 1);
    obj.setCellTemplate(new AW.Templates.Combo, 5);
    obj.setCellTemplate(new AW.Templates.Combo, 6);
        
    //  Populate the list, set the onItemClicked to move selection to cell, then hide the list.
    obj.setPopupTemplate(function(col, row){
    
        var list = new AW.UI.List;
            if(col==1){
                list.setItemText("Mr.", "Mrs.", "Ms.", "Dr.");
                list.setItemCount(4);
            } else if(col==5){
                list.setItemText("Jr.", "II", "III", "IV");
                list.setItemCount(4);
            } else if(col==6) {
                list.setItemText("Bride", "Groom", "Both");
                list.setItemCount(3);
            }
        
        list.onItemClicked = function(event, i){
            var selectedText = this.getItemText(i);
            obj.setCellText(selectedText, col, row);
            obj.setCellValue(selectedText, col, row);
            obj.getCellTemplate(col, row).hidePopup();
        }
        
        return list;
        
    });


But again, all 3 lists are empty in FF and IE.
Jeremy Savoy
January 21,
Ok, I found the problem ... very simple syntax error, did not enclose the setItemText list in [ ] :

This:
list.setItemText("Mr.", "Mrs.", "Ms.", "Dr.");


Should be this:
list.setItemText([b][[/b]"Mr.", "Mrs.", "Ms.", "Dr."[b]][/b]);
Jeremy Savoy
January 21,

This topic is archived.

See also:


Back to support forum