New Javascript component: onStatusChange and rpc client problem

Hi i’m doing some test to create a new javascript component. I read all the documentation about this, but i have one question:
I created :

  • Server-Side class that extends AbstractJavaScriptComponent.
  • State class that extends JavaScriptComponentState
  • and pure javascript file.

All work fine.

Than i added an rpcclient call in my server side class like:
public void addLayer(Layer layer){
// callFunction(“addLayer”, layer);
getRpcProxy(JWidgetClientRpc.class).addLayer(layer);
}

and i added in the javascript file the relative function:
this.registerRpc({
addLayer: function(layer) {
alert("Layer3: "+layer);
}

The call work, but the problem is that every time that is invoked, before that function, is always invoked also onStatusChange inside my javascript file.
For me is a strange behaviour because i haven’t changed the status of the component. This happen also with simple rpc call ( ex.: callFunction(“addLayer”, layer); ), but only for pure javascript component. If i do the same things with a gwt widget, when i call the rpc client method, it works like aspected (without enter inside onStatusChange).

What i missing???

We think this might be a bug in Vaadin. Could you
open a new ticket
about the issue?

Thanks for your reply.


#13290
New ticket created :

I see the same behavior.

I trield to to use callFunction() method passing a JavaBean, but on JavaScript side it is undefined.
Then I tried getRpcProxy - registerRpc approach as described in
Using complex Java types from JavaScript
wiki.

It works! However onStateChage function is called every time I call the RPC function.

Thanks for looking into
this
.