Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Datasource and Resultset

    Hi,

    The issue is that the first log entry displays the correct value for pk. However the second one displays a null value.

    Doesn't the resultset maps the datasource records? I want to get the records stored in the datasource. I have the system working with RecordList but I want to move it to more generic Datasource.

    Here is the code:
    Code:
    DataSource datasource = IlsItemSupplyDS.getInstance();
    datasource.fetchData();
    DataClass[] data = datasource.getTestData();
    GWT.log(data[1].getAttribute("pk"));
    ResultSet resultset = new ResultSet(datasource);
    IlsItem item = null;
    Record b = resultset.get(1);
    GWT.log(b.getAttribute("pk"));
    And the datasource looks like:
    Code:
    DataSourceIntegerField pkField = new DataSourceIntegerField("pk");
    pkField.setHidden(true);
    pkField.setPrimaryKey(true);
    
    DataSourceTextField friendlyNameField = new DataSourceTextField("friendlyName", "Name");
    friendlyNameField.setRequired(true);
    
    setFields(pkField, friendlyNameField, friendlyNameFiel);
    
    setClientOnly(true);
    setTestData(IlsItemDatabase.getRecords());
Working...
X