Forgot what I say, I didn't try the case you just mentioned. Will take a look
during codesprint. But, if you feel like sending a patch to solve this, it'll
be
very good first step.
best,
amaneiro
On 10/07/11 23:57, Flavio Pompermaier wrote:
> They seems equals, but they aren't..to discover the difference do the
> following steps:
>
> 1) Start edition on a vect layer
> 2) Remove a column from its table structure
> 3) Open NavTable. Now you can see that (for example in the method
> fillValues()),
> layer.getRecordset() and layer.getSource().getRecordset() are different.
>
> The first one doesn't recognize the removal of the field from the
> layer structure, while the second one does.
>
> I think that mantaining a recordset field in AbstractNavTable is
> dangerous and could lead to these kind of errors.
> I think that it should be better to re-read the recordset infos every
> time within methods (via layer.getSource().getRecordset()).
>
> The other error of NavTable discussed in this thread (i.e. save button
> not enabled during editing) could be resolved if, within the method
> getChangedValues(), layer.getSource().getRecordset() is used instead
> of layer.getRecordset().
> Obviously, then also the method enableSaveButton() f AbstractNavTable
> must be changed (remove the string "&& layer.isEditing()")..becoming:
>
> protected void enableSaveButton(boolean bool) {
> if (layer != null) {
> saveB.setEnabled(false);
> } else if (!isChangedValues()) {
> saveB.setEnabled(false);
> } else {
> saveB.setEnabled(bool);
> }
> }
>
> Best regards,
> Flavio
> 2011/7/10 Andrés Maneiro<[email protected]>:
>> On 07/07/2011 12:07 PM, Flavio Pompermaier wrote:
>>> The problem of NavTable, from what I saw, is that it relies on the
>>> recordset of a layer. This is wrong during edition, because
>>> layer.getRecordset() is different from layer.getSource.getRecordset().
>>> This is also the cause of the error of non-updated fieldNames if a
>>> column is removed from the table structure.
>>>
>>
>> Flavio,
>>
>> after quickly reviewing gvsig code, I don't see where is the diference
>> from layer.getRecordset() and layer.getSource().getRecordset().
>>
>> If you look at first method at FLyrVect.java class, you will see that
>> layer.getRecordset() will call to layer.getSource().getRecordset()
>> (where the recordset is initialized along some other things). The method
>> behaves like a singleton in the sense it only allows for one recordset
>> in the layer.
>>
>> Navtable foundations are properly working :)
>>
>> best,
>> amaneiro
>> _______________________________________________
>> Navtable-devel mailing list
>> [email protected]
>> https://lists.forge.osor.eu/listinfo/navtable-devel
>>
> _______________________________________________
> Navtable-devel mailing list
> [email protected]
> https://lists.forge.osor.eu/listinfo/navtable-devel
_______________________________________________
Navtable-devel mailing list
[email protected]
https://lists.forge.osor.eu/listinfo/navtable-devel