I have a tree table with 3 levels of hierarchy. The 3 levels come from 3 different view objects based on a single entity object. All 3 view objects are ordered by the same column ALT_SEQ_NBR. This value is unique and comes from a sequence and is not a primary key.
The requirement is to have the ability to move each record within their respective levels move up or down by swapping their ALT_SEQ_NBR values and reordering them.
When I try to sort the unmodified tree table with SortCriterion, it works well. However, when I swap the ALT_SEQ_NBR values or add a new row to the tree, the new or modified rows do not take part in the sorting process, they stay in their respective positions.
The first level always gets sorted. The problem occurs with the child levels. If I commit my changes (after editing or inserting a new child row), then the child elements move up or down as per the sorting logic. However, I am not allowed to commit immediately after making any change to the tree table.
The sorting logic for new/modified rows works with a normal table if I use
setQueryMode(ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES | ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
I also have the child level tree bindings on the page and I have tried to apply the setQueryMode to the individual view objects and re-query them. But while all the unmodified siblings at level 2 or level 3 move up or down, the swapped ones don't.
Let me know if any one has any idea.
Thank you,
Anirban Mukherjee