Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9141897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:42:21+00:00 2026-06-17T09:42:21+00:00

I am trying to implement an API (SCORM API) using GWT. The client code

  • 0

I am trying to implement an API (SCORM API) using GWT.
The client code expects an API object with methods like Initialize(), getLastError() and so on…

I tried to implement this api as an Java Object, but i see that the compiled names are changed and cannot be used directly by client code.

I see that gwt-exporter can do the trick (http://code.google.com/p/gwt-exporter/) but i would like to know how to do it using pure gwt and jsni.

As the API is expected as a object, named API_1484_11 attached to the window object, not an function, , i don’t see how to use the $entry() idiom.

Here is my current, failing, code:

public final class SCORMApi {

    protected SCORMApi() {}

    public void Initialize(){
        GWT.log("** INITIALIZE CALLED **");
    }

    public static void create(){
        bind(new SCORMApi());
    }

    public static native void bind(SCORMApi api) /*-{
        $wnd.API_1484_11 = api;
    }-*/;

}

So, in this context, my question is:

How can i get javascript calls (e.g. window.API_1484_11.Initialize() ) to reach my java gwt code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:42:22+00:00Added an answer on June 17, 2026 at 9:42 am

    You’re on the right lines with your bind method. But you haven’t understood how to call Java methods from within JSNI. This is how you do it in the case of your Initialize method:

    public static native void bind(SCORMApi api) /*-{
        $wnd.API_1484_11 = {
            initialize: function() {
                $entry( api.@com.yourpackage.name.SCORMApi::Initialize()() );
            }
        };
    }-*/;
    

    The blogs Getting To Really Know GWT parts 1 and 2 are required reading on this subject.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Iam trying to implement JMS using eclipse.But when I tried to save the code,
I am trying to implement the Windows Update Agent API asynchronous download/installation methods, however,
I am trying to implement a simple request to Wikipedia's API using AJAX (XMLHttpRequest).
I'm planning to implement a FUSE filesystem using low-level API and currently trying to
I'm trying to implement an API that performs some really lengthy tasks using a
I am trying to implement a layout using the new YouTube Player API for
I'm trying to implement a simple Django service with a RESTful API using tastypie.
I'm trying to implement scripting capability to my application. I'm using the code below.
I'm trying to implement a Login with Facebook using the Open Graph API. So
I'm trying to implement Like via the facebook open-graph-api with the Facebook iOS SDK

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.