User Profile & Activity

Ellen Member
Page
of 2

Meta tag worked for IE9.

I have exactly same JScript exception when I try to get  more rows.

WebCombo version 4, Internet Explorer 9.

Posted: January 17, 2011 1:20 PM

Hi Yudi,

The Parent combo is called wcboTechnique and the Child combo is wcboInstrumentGroup. I add a row to wcboInstrumentGroup onShowDropDown event. Combo boxes are populated dynamically in the table. They have “id” what is their numeric number in the table: for example wcboTechnique1, wcboInstrumentGroup1; wcboTechnique2, wcboInstrumentGroup2, etc.

I also have to use onLostFocus event to explicitly specify the selected row. Otherwise, “Any for technique” will be selected.

 

"InsertAtTop" doesn't do anything, since "Any for technique" is populated immediately and at the top anyway while the rest of the combo is populated a couple seconds later.

Thanks, Ellen

function onInstrumentGroupShowDropDown(id) {

    var combo2 = ISGetObject("wcboInstrumentGroup" + id);

    var newRow;   

    rows = combo2.GetRows();

    if (rows[0]) {

        cells = rows[0].GetCells();

        if (cells.GetNamedItem("Description")) {

            if (cells.GetNamedItem("Description").Text != "Any for technique") {

                newRow = combo2.NewRow("-1");

                cells = newRow.GetCells();

                cells.GetNamedItem("Description").Text = "Any for technique";                

                rows.Add(newRow);

                combo2.InsertAtTop = true;               

                combo2.UpdateUI();                    

            }

        } else {

            newRow = combo2.NewRow("-1");

            cells = newRow.GetCells();

            cells.GetNamedItem("Description").Text = "Any for technique";           

            rows.Add(newRow);

            combo2.InsertAtTop = true;

            combo2.UpdateUI();           

        }

    } else {

        newRow = combo2.NewRow("-1");

        cells = newRow.GetCells();

        cells.GetNamedItem("Description").Text = "Any for technique";

        rows.Add(newRow);

        combo2.InsertAtTop = true;

        combo2.UpdateUI();       

    }  

}

 

function onInstrumentGroupLostFocus(id) {

    // Since "Any for technique" is added on ShowDropDown event, it is highlighted automatically even if

    // another InstrumentGroup is selected. hdnInstrGroupDesc is set based on intentionally selected InstrumentGroup

    // and helps to retain the correct value.

 

    var combo2 = ISGetObject("wcboInstrumentGroup" + id);

    var selectedText = combo2.Text;

    if (combo2.Text == "Any for technique" && combo2.Value == "") {

        eval("document.all.hdnInstrGroupDesc" + id).value = combo2.Text;

    }  

    var InstrGroupDesc = eval("document.all.hdnInstrGroupDesc" + id).value;   

    combo2.SetText(InstrGroupDesc);

}

Hi Martin,

I solved the problem. The error message was "Microsoft JScript runtime error: '_attrInit' is null or not an object". The reason was setting Timeout to 650, what was not enough. After I set it to 2000, everything started working fine.

Thank you, Ellen

Hi Martin,

 

I tried the code (“var wcCategory = ISGetObject(controlId)” is not used) and it has the same problem that I have been struggling with:

wcProduct.ShowDropDown();” doesn’t open dropdown, it only shows DropDown symbol (as said in the Reference). The element Rows of wcProduct is still null and no row can be selected.

 

Thank you,

Ellen

Martin,

 

Thank you for replying.

Is it possible to use combo.SetSelectedIndex(0) instead of SetText()?

Is there a simple way to select the first row?

 

Thanks, Ellen.

 

Thank you, Handy.

Posted: November 3, 2010 10:59 AM

Martin,

Thank you very much for the library link.

The combo box content is aligned to the right when the length of the contect exceeds the length of the combo box. I figured out that I had to use LayoutSettings.ColumnStyle.HorizontalAlign property.

Ellen


Posted: October 28, 2010 6:30 PM

Yudi,

"cbo2.LoadValue();" is what I didn't know about. It fixed the problem.

Thank you!


 

Niven,

Thank you for your help. 

Actually, it was my mistake. I instead of ISGetObject, I used IsGetObject what caused all the trouble.

-Ellen

 

Thank you for your help. 

Actually, it was my mistake. I instead of ISGetObject, I used IsGetObject what caused all the trouble.

-Ellen

 

All times are GMT -5. The time now is 8:48 PM.
Previous Next