how to order strings?
hi,
i have to show some String in my jsp .. this Strings i get dynamiclly from my Database.
now i am showing the String . but i need to make it possible for the admin in a admin jsp to
change the ORDER of the String (sometimes alphabet , sometimes index )
for every string in database i have attribute "index".
how can i do this in the best way ?
want to show the lines and let the admin chose a new order?
something like this:
string 11
string 22
strnig 33
new order:
string 22
string 33
string 11
please anyone an idea?
thankx
[631 byte] By [
golanblna] at [2007-11-26 16:32:01]

# 2
As far I understand he just want to manually order the items and not order them by natural string order or so (which is fairly easy to implement using Collections.sort() however).
Well, you can implement it in two ways: using clientside Javascript or using serverside JavaEE. If Javascript, then Google on "javascript moveup movedown" or so. If JavaEE, then just do something like:
public void moveUp() {
int currentIndex = items.indexOf(selectedItem);
items.remove(selectedItem);
items.add(currentIndex - 1, selectedItem);
}