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 6787969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:25:45+00:00 2026-05-26T17:25:45+00:00

I’m trying to get a simple GXT application to retrieve data from an external

  • 0

I’m trying to get a simple GXT application to retrieve data from an external server using REST.

I have found the following example online, and for the life of me, I cannot understand why my table isn’t getting populated. It also appears as if the data isn’t retrieved. I would appreciate any help! Thank you.

/*
 * Ext GWT 2.2.3 - Ext for GWT
 * Copyright(c) 2007-2010, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */
package com.extjs.gxt.samples.mail.client.widget;


import java.util.ArrayList;
import java.util.List;

import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
import com.extjs.gxt.ui.client.Style.Orientation;
import com.extjs.gxt.ui.client.data.BaseListLoader;
import com.extjs.gxt.ui.client.data.HttpProxy;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.data.XmlReader;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.Grid;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import com.google.gwt.http.client.RequestBuilder;


public class ContactPanel extends ContentPanel {

  @SuppressWarnings("rawtypes")
public ContactPanel() {


        setHeading("Contacts");     
        setStyleAttribute("margin", "5px");
        setHeaderVisible(true);
        setBodyBorder(true);

        setAutoHeight(true);
        setLayout(new RowLayout(Orientation.VERTICAL));


        List<ColumnConfig> configs = new ArrayList<ColumnConfig>();   
        configs.add(new ColumnConfig("departureCity", "From", 120));  
        configs.add(new ColumnConfig("arrivalCity", "To", 120));  

        ColumnConfig config = new ColumnConfig("departureTime", "departureTime", 150);  
        config.setAlignment(HorizontalAlignment.LEFT);
        configs.add(config);

        configs.add(new ColumnConfig("arrivalTime", "Arrivaltime", 150));  
        configs.add(new ColumnConfig("flightNo", "Flightnr", 70));  
        config = new ColumnConfig("price", "Price", 120);
        config.setAlignment(HorizontalAlignment.LEFT);
        configs.add(config);  

        ColumnModel cm = new ColumnModel(configs);



        ModelType type = new ModelType();  
        type.setRoot("flightList");
        type.setRecordName("flight");   

        type.addField("departureCity");  
        type.addField("arrivalCity");  
        type.addField("departureTime");  
        type.addField("arrivalTime");  
        type.addField("flightNo");  
        type.addField("price");  

        // use a http proxy to get the data  
        RequestBuilder builder = new RequestBuilder(
                RequestBuilder.GET,
                //"/flights.xml");
                "http://tutorialsjava.com/demo/flights.xml");
        HttpProxy proxy = new HttpProxy(builder);  

        // need a loader, proxy, and reader  
        XmlReader reader = new XmlReader(type);  

        final BaseListLoader loader = new BaseListLoader(proxy, reader);  

        ListStore<ModelData> store = new ListStore<ModelData>(loader);  
        final Grid grid = new Grid<ModelData>(store, cm);  

        grid.setStyleAttribute("borderTop", "none");    
        grid.setBorders(true);   
        grid.setStripeRows(true);   
        grid.setAutoWidth(true);
        grid.setHeight(160);
        grid.getView().setForceFit(true);

        loader.setRemoteSort(true);
        loader.load();

        add(grid);   

      }




}
  • 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-26T17:25:45+00:00Added an answer on May 26, 2026 at 5:25 pm

    It seems your code is making a cross-domain request, thus using the ScriptTagProxy class would be more appropriate here. GXT documentation states:

    Note that if you are retrieving data from a page that is in a domain that is NOT the same as the originating domain of the running page, you must use this class, rather than HttpProxy.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

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.