Announcement

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

    ListGrid with no DataSource saving issue

    Hi,

    im having problem saving extra column value in a ListGrid that is not linked to a datasource.

    i manually added some fields to the ListGrid, and get data from a datasource.fetchData(), some of the fields in the ListGrid are in the fetch result, some are not, e.g.

    ListGridField:
    product_name, product_code, quantity

    Fetch result:
    product_name, product_code

    when i manually save the record after typing in a quantity, it says quantity is null. like this:

    Code:
    Record[] records listGrid.getRecords();
    for(Record r:records) {
       String quantity = r.getAttribute("quantity");
    }
    is there anything wrong? or what the correct way to add extra fields into a ListGrid? Thanks!

    #2
    What do you mean by "manually save the record"?

    Comment


      #3
      it means manually get values from the grid.getRecords(), make the Record, and execute datasource.addData(record)

      Comment


        #4
        Try to be much more complete in your question and in explaining what you're expecting to happen.

        A call to DataSource.addData() will at most add new records to a ListGrid that has a DataSource and a ResultSet. It will never update existing records - only a DataSource.updateData() call would do that (via cache sync - see ResultSet class doc).

        Comment

        Working...
        X