0

我编写了一个代码来从文本框中读取输入数据,然后单击提交按钮,该数据将显示在列表网格中。提交按钮点击事件代码在这里:

public void onClick(ClickEvent event) {sendInfoToSever();}
private void sendInfoToSever() {
            String Ename=firstName.getText();
            String Eemail=Email.getText();
            String Equerytype=rgi.getDisplayValue();
            String Edesignation1=check1.getFormValue();
            String Edesignation2=check2.getFormValue();
            String Econtact=Contact.getText();

            int indx=li1.getSelectedIndex();
            String Ecountry=li1.getValue(indx);
            String Equerytext=queryText.getText();
            showData.setWidth(475);
            showData.setHeight(100);

            ListGridField Lname= new ListGridField("name", "Name");
            ListGridField Lemail= new ListGridField("email", "Email");
            ListGridField Lquerytype= new ListGridField("Query Type");
            ListGridField Ldesignation1= new     ListGridField("Designation");
            ListGridField Ldesignation2= new     ListGridField("Designation");
            ListGridField Lcontact= new ListGridField("Contact");
            ListGridField Lcountry= new ListGridField("Country");
            ListGridField Lquerytext= new ListGridField("Query Text");
            showData.setFields(Lname,Lemail, Lquerytype, Ldesignation1, Ldesignation2, Lcontact, Lcountry, Lquerytext);
   } 
}

如何将文本框数据设置为 listgrid 字段?

谢谢

4

1 回答 1

0

尝试这样的事情:

YourCustomRecordObject[] data = new YourCustomRecordObject[]{  
                new YourCustomRecordObject(firstName.getText(), Email.getText(), ..all other fields.. )
};
showData.setData(data);

public class YourCustomRecordObject {

    public String name;
    public String email;
    .. all other fields..

    public YourCustomRecordObject(String name, String email, ..all other fields..) {
        this.name = name;
        this.email = emal;
        .......
    }

    .. getters and setters..
}
于 2013-04-12T09:21:37.683 回答