I'm using DWR to write a AJAX.
The creator method is
public ArrayList<CompanyRecord> step4QueryTable() throws JCoException
{...}
The CompanyRecord class is
public class CompanyRecord {
private String Code;
private String Name;
public void setValue(String value1,String column1)
{
if (column1.equals("Code"))
{
this.Code=value1;
}
else
{
this.Name=value1;
}
}
public String getValue(String column1)
{
if (column1.equals("Code"))
{
return Code;
}
else
{
return Name;
}
}
}
In dwr.xml I configured the converter like below
<convert converter="bean" match="com.SCOfetch.CompanyRecord">
<param name="include" value="Code,Name" />
</convert>
In JSP I create a method
function bclick(){
var result=[];
SAPget.step4QueryTable(function(data){
for(var i=0;i<data.length;i++){
alert(data.Code);
}
})}
And alert message result is always undefined. What I missed?Can anyone help?Thanks.
Looks like my CompanyRecord class is not a valid javaBean. I updated it and now it works.