Hi,

In my gwt client code I'm sending a java bean to the javascript
function and from that javascript function I'm calling the bean's get
method. However, I'm getting exception as ""

My code is as follows
<CODE>

public class TestBean {

        String t1;

        String t2;

        public TestBean(String t1, String t2) {
                this.t1 = t1;
                this.t2 = t2;
        }

        public String getT1() {
                return t1;
        }

        public void setT1(String t1) {
                this.t1 = t1;
        }

        public String getT2() {
                return t2;
        }

        public void setT2(String t2) {
                this.t2 = t2;
        }
}


// Client java code is

protected static native void launch(TestBean t) /*-{
         $wnd.alert("TEST");
         $wnd.getT1 = @com.test.model.TestBean::getT1();
         $wnd.runMyTest(t);
        }-*/;

// And javascript code is

function runMyTest(t)
{
    alert("HI");
    var excel = new ActiveXObject("Excel.Application");
    var workbook = excel.Workbooks.Add();
    var worksheet = workbook.Worksheets(1);
    worksheet.Cells(1, 1).Value = t.getT1();
    worksheet.Cells(1, 2).Value = "Second Cell";
    excel.Visible = true;
    excel.UserControl = true;
    excel.quit();
}


// I tried with replacing the following line
// worksheet.Cells(1, 1).Value = t.getT1();
// by
// worksheet.Cells(1, 1).Value = [email protected]::getT1();
// However, its still didn't work.

</CODE>
Please help


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to