I'd like to create a combobox which will get users from an arrayList & another field for creating a new user.
for example when i open the combobox i'd like to see the r开发者_StackOverflow中文版ows :
Create new user
User A User B
where the users come form an arrayList and the "create new user" option is always there.
How can I do it?
P.S
I don't wan't to add "create new user" obj to the arryList - so this is not a desired solution.
Thanks for your help,
DanJust create an intermediate ArrayList, add the "create new user" option to it, copy all the elements from the other ArrayList, and finally assign it to the combobox:
var cbArray = new ArrayList();
cbArray.push("Create new user ");
for (int i = 0; i < yourArrayList.lenght; i++) {
cbArray.push(yourArrayList[i]);
}
// Then assign cbArray to the combo box
精彩评论