Combobox, problem in second time

Hi Support

I have two select box on the jsp page.

If I select any value from my first drop down box, the second box will be populated based on the value of first box…



Now I want my second box to be made editable, for this I am trying to use your dhtmlx combo.



When first time I am selecting value from the first box, second box is getting populated, but when again I change the value of the first box, second box is not getting populated.



Here is the code:





<nested:select property=“fieldName1” style=“width:150px” styleId=“fieldName1”>

Select Field

<nested:optionsCollection property=“fieldNameList” value=“value”

label=“key”></nested:optionsCollection>

</nested:select>













function populateValues(fname,fvalue)

{

    ��…

���

��.

����



var cwList=dhtmlXComboFromSelect(“fieldValue1”);



���…

��…

��…

��…



}







<nested:select property=“fieldValue1” name=“reportForm” style=“width:162px” styleId=“fieldValue1”>

<nested:optionsCollection property=“fieldValueList1” value=“value” label=“key”></nested:optionsCollection> </nested:select>





Javascript fails second time after

var cwList=dhtmlXComboFromSelect(“fieldValue1”);



this line . I think second time it is not able to create the object. Its showing the following error in the IE browser



�null is null or not an object�.



Please help me in sorting out this issue.

I think second time it is not able to create the object. Its showing the following error in the IE browser
yes, the select box instance already converted to dhtlmxCombo and second call will cause an error.

The dhtmlXComboFromSelect can be used only once per select box, after that you may interact directly with combo object ( adding|deleting options, loading options set from XML and etc. ) but you can’t operate with source select box control, it is fully removed from DOM.

In you case, the correct solution will be call dhtmlXComboFromSelect initially and manipulate with options inside combo in populateValues method.