Changing order inside a list (swapping a task priority)

Changing order inside a list (swapping a task priority)

Hi people,
  I am trying to swap task priorities and the CurrentRowNumber function is giving me problem. Who knows the function that brings the line number I am using in the list ?
Attached is the screen where I try to click on arrows to change the priority order. I only need to swap the line numbers to everything be fine.

Thanks for any tip
Luciano Schiavo

Which currentrownumber are you using?
and how do you swap it?

so, better giving us a peek at the code, then we can help you better!

That is the problem... I don´t know how to access the current line I picked up...  See code below.
You can use the built-in actions ListRemove() and ListInsert() to remove the record and insert it back where it should be.
Would be nice, but I need to put the number on priority column. This list can be organized in many ways according to the title. Identify the current line in the list is the proper solution. I only need to swap the numbers and refresh the list.
- Identify the position of the entry you need to change
- local_variable = list[position] // make a local copy
- list_remove(list, position)
- = new_value_for_property
- list_insert(list, local_variable, new_position)

Doesn't this procedure allow you to perform all you want ?
Identify the position of the entry you need to change  -> this is the problem, how I know ? Which function I use when I click on an arrow ?
You can go through the list and save the position of the desired entry in a local variable.

- pos = -1
- foreach in list
  - if (criteria is met) pos = list.currentrownumber

at the end of this algorithm you'll either have pos as -1 or as the last entry that meets the condition you set. If you add pos == -1 to the criteria, you'll get the first entry that meets it.

list.currentrownumber is always returning 1.  I confirmed that the link is Ajax Submit.
I had doubts if the problem is related to focus in the line.   So I clicked in the priority field and after I clicked on an arrow... same thing happens.  list.currentrownumber is always returning 1.
   follow the solution I´ve found. A simpler way and the key point was that the CurrentRowNumber is the interator´s index. I did not know that...  
Thanks all for the tips