Example usage for com.google.gwt.jsonp.client JsonpRequestBuilder setPredeterminedId

List of usage examples for com.google.gwt.jsonp.client JsonpRequestBuilder setPredeterminedId

Introduction

In this page you can find the example usage for com.google.gwt.jsonp.client JsonpRequestBuilder setPredeterminedId.

Prototype

public void setPredeterminedId(String id) 

Source Link

Usage

From source file:gov.wa.wsdot.search.client.SearchWidget.java

License:Open Source License

/**
 * Make call to WSDOT data server to retrieve current high impact alerts.
 *//*from  ww w . j  ava2s  . c om*/
private static void getHighwayAlertsData(String url, final String query) {
    JsonpRequestBuilder jsonp = new JsonpRequestBuilder();
    jsonp.setPredeterminedId("HA");

    jsonp.requestObject(url, new AsyncCallback<HighwayAlerts>() {

        @Override
        public void onFailure(Throwable caught) {
            // Just fail silently here.
        }

        @Override
        public void onSuccess(HighwayAlerts alerts) {
            if (alerts.getAlerts().getItems() != null) {
                updateHighwayAlertsResults(alerts, query);
            }
        }

    });
}