[ 
https://issues.apache.org/jira/browse/ADFFACES-382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Fan updated ADFFACES-382:
------------------------------

    Attachment: RowKeyFix.patch

This patch is my proposed fix for this issue. It has the following parts:
1. In SortableModel, getRowKey() now returns Integer with base index value 
(originally it returns string with sorted index value). 
2. In SortableModel, setRowKey() accepts Object parameter (originally it 
accepts String) with base index Integer type value. Other object type will be 
treated as -1 and error will be logged. 
3. The original SortableModel has two lines of code calling new Integer(). They 
are changed to call Integer.valueOf().
4. RowKeySetImplTest and RowKeySetTreeImplTest was changed to adapt to the 
changes above. rowKey type changed to Integer and serialization size limit was 
increased (due to the rowKey type changed from String to Integer).
The SortableModel will have impact to rowKeys in tree/treeTable (change from 
array of String to array of Integer).

> SortableModel.getRowKey() returns sortedIndex
> ---------------------------------------------
>
>                 Key: ADFFACES-382
>                 URL: https://issues.apache.org/jira/browse/ADFFACES-382
>             Project: MyFaces ADF-Faces
>          Issue Type: Bug
>         Environment: ALL
>            Reporter: John Fan
>         Attachments: RowKeyFix.patch
>
>
> In SortableModel class, getRowKey() returns sorted index of the current row. 
> For the same row object, different sorting can change its sorted index and 
> hence change its rowKey.
> getRowKey() should return base index, because base index of a row object will 
> not be changed by sorting. If we change getRowKey(), we need to change 
> setRowKey() too.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to