日期:2014-05-18  浏览次数:20734 次

问个问题,希望大伙留步!~
jsp中实现左边框中的记录选择到右边框,比如oracle   10g操作界面的role管理,应该如何实现,用什么方法比较好?

------解决方案--------------------
<SCRIPT LANGUAGE= "JavaScript ">
function move(tbox1) {
fbox=this.combo_box.list4;
var arrFbox = new Array();
var arrTbox = new Array();
var arrLookup = new Array();
var arrtitle = new Array();
var arrtitle1 = new Array();
var i;
for (i = 0; i < fbox.options.length; i++) {
arrLookup[fbox.options[i].text] = fbox.options[i].value;
arrtitle[i] = fbox.options[i].title;
//alert(arrtitle[i]);
arrTbox[i] = fbox.options[i].text;
}
var fLength = 0;
var tLength = arrTbox.length;
for(i = 0; i < tbox1.options.length; i++) {
arrLookup[tbox1.options[i].text] = tbox1.options[i].value;
//alert(tbox1.options[i].title);
if (tbox1.options[i].selected && tbox1.options[i].value != " ") {
arrTbox[tLength] = tbox1.options[i].text;
arrtitle[tLength] = tbox1.options[i].title;
tLength++;
}
else {
arrFbox[fLength] = tbox1.options[i].text;
arrtitle1[fLength] = tbox1.options[i].title;
fLength++;
}
}
arrFbox.sort();
arrTbox.sort();
arrtitle.sort();
arrtitle1.sort();
fbox.length = 0;
tbox1.length = 0;
var c;
for(c = 0; c < arrFbox.length; c++) {
var no = new Option();
no.value = arrLookup[arrFbox[c]];
no.text = arrFbox[c];
no.title = arrtitle1[c];
tbox1[c] = no;
}
for(c = 0; c < arrTbox.length; c++) {
var no = new Option();
no.value = arrLookup[arrTbox[c]];
no.text = arrTbox[c];
no.title = arrtitle[c];
fbox[c] = no;
}
}

function move1() {
fbox=this.combo_box.list4;
var i;
arrtitle2length = 0;
var arrtitle2 = new Array();
var arrFbox = new Array();
var arrLookup = new Array();
var arrtitle = new Array();
var arrTbox1 = new Array();
var arrLookup1 = new Array();
var arrtitle11 = new Array();
var arrTbox2 = new Array();
var arrLookup2 = new Array();
var arrtitle12 = new Array();
var arrTbox3 = new Array();
var arrLookup3 = new Array();
var arrtitle13 = new Array();
for (i = 0; i < fbox.options.length; i++) {
//alert(fbox.options[i].title);
if (fbox.options[i].selected && fbox.options[i].value != " ") {
arrtitle2[arrtitle2length] = fbox.options[i].title;
arrtitle2length++;
//alert(kkk);
}
}
tbox1=this.combo_box.list1;
tbox2=this.combo_box.list2;
tbox3=this.combo_box.list3;
for (i = 0; i < tbox1.options.length; i++) {
arrLookup1[i] = tbox1.options[i].value;
arrtitle11[i] = tbox1.options[i].title;
arrTbox1[i] = tbox1.options[i].text;
}
for (i = 0; i < tbox2.options.length; i++) {
arrLookup2[i] = tbox2.options[i].value;
arrtitle12[i] = tbox2.options[i].title;
arrTbox2[i] = tbox2.options[i].text;
}
for (i = 0; i < tbox3.options.length; i++) {
arrLookup3[i] = tbox3.options[i].value;
arrtitle13[i] = tbox3.options[i].title;
arrTbox3[i] = tbox3.options[i].text;
}
var fLength = 0;
var tLength1 = arrTbox1.length;
var tLength2 = arrTbox2.length;
var tLength3 = arrTbox3.length;
for(i = 0; i < fbox.options.length; i++) {
if (fbox.options[i].selected && fbox.options[i].value != " ") {
if(fbox.options[i].title== "list1 "){
arrLookup1[tLength1] = fbox.options[i].value;
arrTbox1[tLength1] = fbox.options[i].text;
arrtitle11[tLength1] = fbox.options[i].title;
tLe