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

  • SEARCH
  • Home
  • 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 6545465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:35:19+00:00 2026-05-25T11:35:19+00:00

First, yes I have searched already and found this answer already: GWT JSNI –

  • 0

First, yes I have searched already and found this answer already:

GWT JSNI – problem passing Strings

I’m trying to call a java method from a JSNI method, but not getting anywhere. I’ve tried the advice given above, but it still won’t work.

Here’s the code:

public native void initCustomListeners(MapmakerMapViewPresenter.MyView view) /*-{
//public native void initCustomListeners() /*-{

    $wnd.getLocationDescriptions = function(lng, lat) {
        $entry(view.@org.jason.mapmaker.client.view.MapmakerMapViewImpl::getLocationDescriptions(DD)(lng, lat));
    }

    $wnd.google.maps.event.addListener(map, 'click', function(event) {
        var lat = event.latLng.lat().toFixed(3);
        var lng = event.latLng.lng().toFixed(3);
        alert("(" + lat + ", " + lng + ")");
        $wnd.getLocationDescriptions(lng, lat);

        alert("Test!");
    });
}-*/;    @Override
public void getLocationDescriptions(double lng, double lat) {
    getUiHandlers().doGetLocationDescriptions(lng, lat);
}

Can anyone help me out?

Jason

  • 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-05-25T11:35:20+00:00Added an answer on May 25, 2026 at 11:35 am

    I don’t know if that’s the issue (you don’t even say how that code behaves vs. how you expect it to behave) but there are a few bugs in your code:

    • $entry wraps a function, so you have to call the function it returns, rather than (uselessly) wrap the result of the function after calling it!
      I.e. $entry(function(lat,lng) { foo.@bar.Baz::quux(DD)(a, b); } rather than $entry(foo.@bar.Baz::quux(DD)(a, b))

    • you addListener on a map but that variable is never defined.

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

Sidebar

Related Questions

I have searched this web looking for an answer, but it seems that this
I've searched long and hard for an answer to doing this & have come
I have searched far and wide for an answer to this question and would
Yes i have this line in my first upload case of the switch: $file_name
I have an AXIS2/JAX-WS web service using a code first implementation (yes I know,
First, yes I know about this question , but I'm looking for a bit
First a basic out line of what I am trying to do I have
Update 3 (Read This First) : Yes, this was caused by the object profile
first of all, i have to tell you that i have searched here and
This is an extension of this question . I have searched on the web

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.