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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:28:56+00:00 2026-06-14T17:28:56+00:00

Im new using this front end framework application… I recently started to work with

  • 0

Im new using this front end framework application…

I recently started to work with smartgwt and i’m bulding a new application with a Spring MVC integration.

I’m using a ListGrid with a RestDataSource (Consume the Rest service with mvc:annotation-driven for plain JSON)

I can see that the servaice gets consuming properly perhaps my grid is never shown with the data in it.

Can someone help me here ?

Here’s my ListGrid class

public class ListGrid extends com.smartgwt.client.widgets.grid.ListGrid {

private final SpringJSONDataSource springJSONDataSource;

public ListGrid(List<DataSourceField> fields) {
    this(new PatientDataSource(fields));
}

public ListGrid(SpringJSONDataSource springJSONDataSource) {
    this.springJSONDataSource = springJSONDataSource;
    init();
}

private void init() {
    setAutoFetchData(true);
    setAlternateRecordStyles(true);
    setEmptyCellValue("???");
    setDataPageSize(50);

    setDataSource(springJSONDataSource);
}

}

Now there’s the DataSource implmentation

public abstract class SpringJSONDataSource extends RestDataSource {

protected final HTTPMethod httpMethod;

public SpringJSONDataSource(List<DataSourceField> fields) {
    this(fields, HTTPMethod.POST);
}

public SpringJSONDataSource(List<DataSourceField> fields, HTTPMethod httpMethod) {
    this.httpMethod = httpMethod;
    setDataFormat(DSDataFormat.JSON);
    addDataSourceFields(fields);
    setOperationBindings(getFetch());
    addURLs();
}

private void addURLs() {
    if(getUpdateDataURL() != null)
        setUpdateDataURL(getUpdateDataURL());

    if(getRemoveDataURL() != null)
        setRemoveDataURL(getRemoveDataURL());

    if(getAddDataURL() != null)
        setAddDataURL(getAddDataURL());

    if(getFetchDataURL() != null)
        setFetchDataURL(getFetchDataURL());

}

private void addDataSourceFields(List<DataSourceField> fields) {
    for (DataSourceField dataSourceField : fields) {
        addField(dataSourceField);
    }
}

protected abstract OperationBinding getFetch();
protected abstract OperationBinding getRemove();
protected abstract OperationBinding getAdd();
protected abstract OperationBinding getUpdate();

public abstract String getUpdateDataURL();
public abstract String getRemoveDataURL();
public abstract String getAddDataURL();
public abstract String getFetchDataURL();

}

The class PatientDataSource that extends SpringJSONDataSource

public class PatientDataSource extends SpringJSONDataSource {

public PatientDataSource(List<DataSourceField> fields) {
    super(fields);
    setPrettyPrintJSON(true);
}

@Override
protected OperationBinding getFetch() {
    OperationBinding fetch = new OperationBinding();
    fetch.setOperationType(DSOperationType.FETCH);
    fetch.setDataProtocol(DSProtocol.POSTMESSAGE);
    DSRequest fetchProps = new DSRequest();
    fetchProps.setHttpMethod(httpMethod.toString());
    fetch.setRequestProperties(fetchProps);

    return fetch;
}

@Override
public String getFetchDataURL() {

    return "/spring/fetchPatients";
}

@Override
protected OperationBinding getRemove() {
    return null;
}

@Override
public String getRemoveDataURL() {
    return null;
}

@Override
protected OperationBinding getAdd() {
    return null;
}

@Override
public String getAddDataURL() {
    return null;
}

@Override
protected OperationBinding getUpdate() {
    return null;
}

@Override
public String getUpdateDataURL() {
    return null;
}

}

My spring controller PatientControler

@Controller
public class PatienController {

Logger logger = Logger.getLogger(PatienController.class);

@Autowired
private PatientServices patientServices;

@RequestMapping(value = "/patientTest", method = RequestMethod.GET)
@ResponseBody
public Object getTest()
{
    return patientServices.getAllPatients();
}

@RequestMapping(value = "/fetchPatients", method = RequestMethod.POST)
@ResponseBody
public Object getAllPatients()
{
    return patientServices.getAllPatients();
}

}

PatientServiceImpl

public class PatientServicesImpl implements PatientServices {

public List<Patient> getAllPatients() {

    List<Patient> patients = new ArrayList<Patient>();
    Patient patient;

    for(int i = 0 ; i < 500 ; i++){
        patient = new Patient();
        patient.setDateOfBirth(new Date());
        patient.setFirstName("Joe");
        patient.setMiddleName("Moe");
        patient.setLastName("Blow");
        patient.setLastConsultation(new Date());
        patient.setSex(Sex.M);

        patients.add(patient);
    }

    return patients;
}

}

*Im Really stuck right now i’ve been looking for all type of answers …. but so far nothing worked when i tried to override the transformResponse from my RestDataSource impentation the parameter “data” as an OBJECT, returns me an array [object Object],[object Object],[object Object],[object Object],[object Object] *

  • 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-14T17:28:57+00:00Added an answer on June 14, 2026 at 5:28 pm

    The Data which is transferred from the RestDataSource has a specific format which is described in the JavaDoc of the RestDataSource
    Your server must understand the request and send back a valid response.

    At the moment your example doesn’t seem to honour the contract.

    To debug the traffic send to and from your server you can use the SmartClient-Console. You can open it by a browser bookmark like this:

    javascript:isc.showConsole()
    

    Of cause you need to deploy this console by adding the following module to your gwt.xml

    <inherits name="com.smartclient.tools.SmartClientTools"/>
    

    Now go to the RPC Tab and check Track-RPCs

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

Sidebar

Related Questions

currently i using this code in phonegap application var xmlhttp = new XMLHttpRequest(); xmlhttp.open(GET,http://192.168.1.19:8080/searchMobile?categoryRequest=true,
I am a front-end guy using Windows for design and html/js/css coding. My work
I am new to spring MVC coming with experience using PHP MVC frameworks and
I am working on an application (using the spring framework) in which current time
This is my front-end code (using fetch ) var MyModel = Backbone.Model.extend(); var MyCollection
I want to create a new object using this $procedure = new ${$s.'\\'.$p}; It
I'm creating new Site Definitions using this method: http://weblogs.asp.net/paulballard/archive/2007/04/09/creating-a-custom-sharepoint-2007-portal-site-definition-using-the-portalprovisioningprovider-class.aspx and when they get created,
I am using this plugin for my new site: http://colorpowered.com/colorbox/ The page in concern
I'm using this code: Dim cListItems As New System.Collections.Generic.List(Of Combobox_values) cListItems.Add(New Combobox_values(One, 1)) cListItems.Add(New
I'm using this coffeescript code: in a spec file: index = new MeetingIndex(render: false,

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.