I'm using gwt and my app can not call the java methods via jnsi, I am
following the standard correct. I do not know why this is happening.
can the container to accepts calls through jnsi java methods?

package gwtopensocial.client;

import java.util.List;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.gadgets.client.Gadget;
import com.google.gwt.gadgets.client.UserPreferences;
import com.google.gwt.gadgets.client.Gadget.ModulePrefs;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;

@ModulePrefs(title = "GWTOpenSocial", author = "kael", author_email = "
mkaelzi...@gmail.com")
public class GWTOpenSocial extends Gadget<UserPreferences> implements
OpenSociable {

Button bt;
String nome;
RootPanel root;

@Override
public void init(UserPreferences preferences) {

root = RootPanel.get();
final Button bt = new Button();
        root.add(bt, 5, 56);
        bt.addClickHandler(new ClickHandler() {

@Override
public void onClick(ClickEvent event) {
requestOwner();
}
        });
        bt.setText("Get Viewer");
root.add(bt);
}

public native void requestOwner()/*-{
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.OWNER),
"owner");
req.send(th...@gwtopensocial.client.gwtopensocial
::responseOwner(Lcom/google/gwt/core/client/JavaScriptObject;));
}-*/;

// resposta do perfil do dono
public native void responseOwner(JavaScriptObject ownerResp)/*-{
var ownerData = ownerResp.get('owner');

if (!ownerData.hadError()) {
var owner = ownerData.getData();
$wnd.alert(owner.getDisplayName());
th...@gwtopensocial.client.gwtopensocial
::onGetViewer(Lcom/google/gwt/core/client/JavaScriptObject;)(ownerData);
}
else{
$wnd.alert(ownerData.getErrorMessage());
th...@gwtopensocial.client.gwtopensocial
::onGetViewer(Lcom/google/gwt/core/client/JavaScriptObject;)(ownerData);
}
}-*/;

public void onGetViewer(JavaScriptObject test) {
root.add(new Label(test.toString()));
}

@Override
public void initializeFeature(OpenSocialFeature feature) {

}

}

thanks!

Michael Robson Feitosa

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Orkut Developer Forum" group.
To post to this group, send email to opensocial-orkut@googlegroups.com
To unsubscribe from this group, send email to 
opensocial-orkut+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to