pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: RowEditor and db
Date Wed, 27 Oct 2010 02:03:06 GMT
This is done. I also added the rowIndex argument. Let me know how it goes.

On Oct 26, 2010, at 9:56 PM, Greg Brown wrote:

> Good catch. What we should be doing is calling store() on a new row object, then updating
the table data if valid is true. I'll make this change.
> 
> On Oct 26, 2010, at 11:46 AM, Thomas Leclaire wrote:
> 
>> Hi again!
>> 
>> In fact, there are still some problems with this editor!
>> 
>> If we look on method close in TableViewRowEditor : 
>> if (result) {
>>            // Update the row data
>>            List<Object> tableData = (List<Object>)tableView.getTableData();//old
data
>>            Object tableRow = tableData.get(rowIndex);//old data
>> 
>>            tablePane.store(tableRow); //tablePane = new data . it's copied in tableRow.
>> 
>>            valid = validate(tableRow, rowIndex);
>> 
>>            if (valid) {
>>                if (tableData.getComparator() == null) {
>>                    tableData.update(rowIndex, tableRow);
>>                ...
>>                }
>>            }
>>        }
>> 
>> 
>> There's a problem because the store method provokes the changes in the source data
directly. 
>> tableview is feeded at instanciation of RowEditor with the original table. Therefore,
modifications on tableRow are modifications on the original table. 
>> so call to store method should be done in the if (valid)
>> But i'm asking myself what is the need of call method update here like modification
was done by method store.
>> 
>> 
>> Regards,
>> Thomas
>> 
> 


Mime
View raw message