I am currently utilizing DWR for AJAX implementation.
The method created by the creator is
public ArrayList<CompanyRecord> step4QueryTable() throws JCoException
{...}
The structure of CompanyRecord class is as follows:
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, the converter was configured in the following manner:
<convert converter="bean" match="com.SCOfetch.CompanyRecord">
<param name="include" value="Code,Name" />
</convert>
Within the JSP file, a method is implemented as shown below:
function bclick(){
var result=[];
SAPget.step4QueryTable(function(data){
for(var i=0;i<data.length;i++){
alert(data.Code);
}
})}
However, the alert message always displays undefined. What could be missing? Any assistance would be appreciated. Thank you.