RPC Server -> client (send Java Bean)

Hi! I have problem with rpc.
I want to send from server to client POJO.
My POJO is

TestData

.
I use RPC for this.
If I call updateData() from MyComponent - Browser show default data from POJO instead my data.

How I can send to client this data?

public class MyComponent extends com.vaadin.ui.AbstractComponent{
    public MyComponent() {
        super();
    }
    public void updateData(){
        getRpcProxy(MyComponentRpc.class).showData(new TestData(55, 43.4f));
    }
}

Data class:

public class TestData implements Serializable { private int info = 2;//default values (any) private float info2 = 3f; public TestData() { } public TestData(int info, float info2) { this.info = info; this.info2 = info2; } @Override public String toString() { return info + " - " + info2; } } Connector:

@Connect(MyComponent.class)
public class MyComponentConnector extends AbstractComponentConnector{
    
    public MyComponentConnector() {
        registerRpc(MyComponentRpc.class, new MyComponentRpc() {
            @Override
            public void showData([u]
[b]
TestData
[/b] data
[/u]) {
                
                Window.alert(data.toString());
                //Browser show "2 - 3"  (default values), instead "55 - 43.4"
            }

        });
    }    
    @Override
    protected Widget createWidget() {
        return GWT.create(MyWidget.class);
    }
    @Override
    public MyWidget getWidget() {
        return (MyWidget) super.getWidget();
    }
}

RPC interface

public interface MyComponentRpc extends ClientRpc {
    public void showData(TestData data);
}

Try adding getters and setters to your POJO (or make the fields public).

Also, to accomplish this, you should better use
shared state
.

Yes, I created getters & setters and it’s worked. I used rpc for study Vaadin. Thank You for help.