Re: getting an error while populating drop down!!
Hi All,
i missed out the <converter> configuration in dwr.xml. it works fine after adding it.
thanks,
Ramkumar
Hi,
I am a newbie to DWR. i am trying to populate a drop down box by returning an object array. I am getting a javascript alert saying [object error].
This is my javascript code.
.......
function populateDepartments()
{
Helper.getAllDepartments(createList);
}
function createList(data)
{
DWRUtil.removeAllOptions("dept");
$("dept").options[$("dept").options.length] = new Option(" ");
DWRUtil.addOptions("dept", data,"costCenterId", "costCenterName");
}
.......
My Java Code
public class Helper {
....
public DepartmentParam[] getAllDepartments()
{
List list = role.getAllDepartments();
DepartmentParam[] depts = (DepartmentParam[]) list.toArray(new DepartmentParam[list.size()]);
return depts;
}
....
}
DepartmentParam has two attributes costCenterId and costCenterName.
Where i am making the mistake?
thanks in advance,
--
Ramkumar
<a href=" http://www.spreadfirefox.com/?q=affiliates&id=0&t=65 "><img border="0" alt="Get Firefox!" title="Get Firefox!" src=" http://sfx-images.mozilla.org/affiliates/Buttons/110x32/safer.gif "/></a>
--
Ramkumar Yadav K,
<a href="http://www.spreadfirefox.com/?q=affiliates&id=0&t=65 "><img border="0" alt="Get Firefox!" title="Get Firefox!" src="http://sfx-images.mozilla.org/affiliates/Buttons/110x32/safer.gif "/></a>
RSS Feed